Fix email dialog width on large phones (#8350)
* Fix email dialog width on large phones * Do it Right™
This commit is contained in:
@@ -3,7 +3,13 @@ import {type GestureResponderEvent, View} from 'react-native'
|
|||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {atoms as a, useBreakpoints, useTheme, type ViewStyleProp} from '#/alf'
|
import {
|
||||||
|
atoms as a,
|
||||||
|
useBreakpoints,
|
||||||
|
useTheme,
|
||||||
|
type ViewStyleProp,
|
||||||
|
web,
|
||||||
|
} from '#/alf'
|
||||||
import {Button, type ButtonColor, ButtonText} from '#/components/Button'
|
import {Button, type ButtonColor, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
@@ -32,7 +38,6 @@ export function Outer({
|
|||||||
testID?: string
|
testID?: string
|
||||||
nativeOptions?: Omit<BottomSheetViewProps, 'children'>
|
nativeOptions?: Omit<BottomSheetViewProps, 'children'>
|
||||||
}>) {
|
}>) {
|
||||||
const {gtMobile} = useBreakpoints()
|
|
||||||
const titleId = React.useId()
|
const titleId = React.useId()
|
||||||
const descriptionId = React.useId()
|
const descriptionId = React.useId()
|
||||||
|
|
||||||
@@ -52,7 +57,7 @@ export function Outer({
|
|||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
accessibilityLabelledBy={titleId}
|
accessibilityLabelledBy={titleId}
|
||||||
accessibilityDescribedBy={descriptionId}
|
accessibilityDescribedBy={descriptionId}
|
||||||
style={[gtMobile ? {width: 400} : a.w_full]}>
|
style={web({maxWidth: 400})}>
|
||||||
{children}
|
{children}
|
||||||
</Dialog.ScrollableInner>
|
</Dialog.ScrollableInner>
|
||||||
</Context.Provider>
|
</Context.Provider>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import {useCallback, useState} from 'react'
|
|||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {web} from '#/alf'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
import {type StatefulControl} from '#/components/dialogs/Context'
|
import {type StatefulControl} from '#/components/dialogs/Context'
|
||||||
import {useGlobalDialogsControlContext} from '#/components/dialogs/Context'
|
import {useGlobalDialogsControlContext} from '#/components/dialogs/Context'
|
||||||
@@ -38,7 +39,7 @@ export function EmailDialog() {
|
|||||||
|
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
label={_(msg`Make adjustments to email settings for your account`)}
|
label={_(msg`Make adjustments to email settings for your account`)}
|
||||||
style={[{maxWidth: 400}]}>
|
style={web({maxWidth: 400})}>
|
||||||
<Inner control={emailDialogControl} />
|
<Inner control={emailDialogControl} />
|
||||||
<Dialog.Close />
|
<Dialog.Close />
|
||||||
</Dialog.ScrollableInner>
|
</Dialog.ScrollableInner>
|
||||||
|
|||||||
Reference in New Issue
Block a user