Add option to align web dialogs to top

This commit is contained in:
Eric Bailey
2025-02-17 16:21:40 -06:00
parent d805dec08f
commit 2dab545d24
3 changed files with 9 additions and 4 deletions
+5 -2
View File
@@ -41,6 +41,7 @@ export function Outer({
children,
control,
onClose,
webOptions,
}: React.PropsWithChildren<DialogOuterProps>) {
const {_} = useLingui()
const {gtMobile} = useBreakpoints()
@@ -116,7 +117,7 @@ export function Outer({
a.inset_0,
a.z_10,
a.align_center,
gtMobile ? a.p_lg : a.p_md,
gtMobile ? a.p_5xl : a.p_xl,
{overflowY: 'auto'},
]}>
<Backdrop />
@@ -124,7 +125,9 @@ export function Outer({
style={[
a.w_full,
a.z_20,
a.justify_center,
webOptions?.alignTop
? undefined
: a.justify_center,
a.align_center,
{
minHeight: web('calc(90vh - 36px)') || undefined,
+3 -1
View File
@@ -60,7 +60,9 @@ export type DialogOuterProps = {
control: DialogControlProps
onClose?: () => void
nativeOptions?: Omit<BottomSheetViewProps, 'children'>
webOptions?: {}
webOptions?: {
alignTop?: boolean
}
testID?: string
}
+1 -1
View File
@@ -22,7 +22,7 @@ import {ReportDialogProps} from './types'
export function ReportDialog(props: ReportDialogProps) {
return (
<Dialog.Outer control={props.control}>
<Dialog.Outer webOptions={{alignTop: true}} control={props.control}>
<Dialog.Handle />
<ReportDialogInner {...props} />
</Dialog.Outer>