[APP-1054] Add option to align web dialogs to top (#7760)
* Add option to align web dialogs to top * Format * Align all dialogs to top, with relative spacing on larger screens for better balance
This commit is contained in:
@@ -41,6 +41,7 @@ export function Outer({
|
|||||||
children,
|
children,
|
||||||
control,
|
control,
|
||||||
onClose,
|
onClose,
|
||||||
|
webOptions,
|
||||||
}: React.PropsWithChildren<DialogOuterProps>) {
|
}: React.PropsWithChildren<DialogOuterProps>) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const {gtMobile} = useBreakpoints()
|
const {gtMobile} = useBreakpoints()
|
||||||
@@ -115,20 +116,21 @@ export function Outer({
|
|||||||
web(a.fixed),
|
web(a.fixed),
|
||||||
a.inset_0,
|
a.inset_0,
|
||||||
a.z_10,
|
a.z_10,
|
||||||
|
a.px_xl,
|
||||||
|
webOptions?.alignCenter ? a.justify_center : undefined,
|
||||||
a.align_center,
|
a.align_center,
|
||||||
gtMobile ? a.p_lg : a.p_md,
|
{
|
||||||
{overflowY: 'auto'},
|
overflowY: 'auto',
|
||||||
|
paddingVertical: gtMobile ? '10vh' : a.pt_xl.paddingTop,
|
||||||
|
},
|
||||||
]}>
|
]}>
|
||||||
<Backdrop />
|
<Backdrop />
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.w_full,
|
a.w_full,
|
||||||
a.z_20,
|
a.z_20,
|
||||||
a.justify_center,
|
|
||||||
a.align_center,
|
a.align_center,
|
||||||
{
|
web({minHeight: '60vh'}),
|
||||||
minHeight: web('calc(90vh - 36px)') || undefined,
|
|
||||||
},
|
|
||||||
]}>
|
]}>
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ export type DialogOuterProps = {
|
|||||||
control: DialogControlProps
|
control: DialogControlProps
|
||||||
onClose?: () => void
|
onClose?: () => void
|
||||||
nativeOptions?: Omit<BottomSheetViewProps, 'children'>
|
nativeOptions?: Omit<BottomSheetViewProps, 'children'>
|
||||||
webOptions?: {}
|
webOptions?: {
|
||||||
|
alignCenter?: boolean
|
||||||
|
}
|
||||||
testID?: string
|
testID?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export function Outer({
|
|||||||
<Dialog.Outer
|
<Dialog.Outer
|
||||||
control={control}
|
control={control}
|
||||||
testID={testID}
|
testID={testID}
|
||||||
|
webOptions={{alignCenter: true}}
|
||||||
nativeOptions={{preventExpansion: true, ...nativeOptions}}>
|
nativeOptions={{preventExpansion: true, ...nativeOptions}}>
|
||||||
<Dialog.Handle />
|
<Dialog.Handle />
|
||||||
<Context.Provider value={context}>
|
<Context.Provider value={context}>
|
||||||
|
|||||||
Reference in New Issue
Block a user