Skip to content

Commit 892a34f

Browse files
authored
CP-12242: Fix toast width covering full screen and blocking interactions outside toast (#3259)
1 parent 1cdc28f commit 892a34f

File tree

3 files changed

+2
-25
lines changed

3 files changed

+2
-25
lines changed

packages/core-mobile/app/new/ContextApp.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@ import { EncryptedStoreProvider } from 'contexts/EncryptedStoreProvider'
77
import { PosthogContextProvider } from 'contexts/PosthogContext'
88
import { ReactQueryProvider } from 'contexts/ReactQueryProvider'
99
import React, { FC, PropsWithChildren } from 'react'
10-
import { Platform } from 'react-native'
1110
import { ConfettiMethods } from 'react-native-fast-confetti'
1211
import { RootSiblingParent } from 'react-native-root-siblings'
13-
import { FullWindowOverlay } from 'react-native-screens'
14-
import Toast from 'react-native-toast-notifications'
1512
import SentryService from 'services/sentry/SentryService'
1613
import { App } from './App'
1714
import JailbreakCheck from './common/components/JailbreakCheck'
1815
import TopLevelErrorFallback from './common/components/TopLevelErrorFallback'
1916

20-
const setGlobalToast = (toast: Toast): void => {
21-
global.toast = toast
22-
}
23-
2417
const setGlobalConfetti = (confetti: ConfettiMethods): void => {
2518
global.confetti = confetti
2619
}
@@ -44,22 +37,6 @@ const ContextApp = (): JSX.Element => {
4437
<App />
4538
</RootSiblingParent>
4639
<JailbreakCheck />
47-
<Toast
48-
ToastContainerWrapper={
49-
Platform.OS === 'ios'
50-
? {
51-
component: FullWindowOverlay,
52-
props: {
53-
children: undefined
54-
}
55-
}
56-
: undefined
57-
}
58-
ref={setGlobalToast}
59-
offsetTop={30}
60-
normalColor={'00FFFFFF'}
61-
/>
62-
6340
<Confetti ref={setGlobalConfetti} />
6441
</ContextProviders>
6542
</Sentry.ErrorBoundary>

packages/core-mobile/app/new/common/utils/toast.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const GlobalToast = (): JSX.Element => {
4343
}
4444
: undefined
4545
}
46+
containerStyle={{ width: undefined }}
4647
placement="top"
4748
animationType="slide-in"
4849
offsetTop={offsetTop}

packages/k2-alpine/src/components/Toast/TransactionSnackbar.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const TransactionSnackbar = ({
110110
onPress={onPress}>
111111
<View
112112
style={{
113-
width: SCREEN_WIDTH,
113+
maxWidth: SCREEN_WIDTH * 0.9,
114114
justifyContent: 'center',
115115
alignItems: 'center'
116116
}}>
@@ -129,7 +129,6 @@ export const TransactionSnackbar = ({
129129
variant="body1"
130130
numberOfLines={1}
131131
sx={{
132-
maxWidth: '80%',
133132
marginLeft: 5,
134133
fontSize: 14,
135134
color: textColor

0 commit comments

Comments
 (0)