Add option to align web dialogs to top
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()
|
||||||
@@ -116,7 +117,7 @@ export function Outer({
|
|||||||
a.inset_0,
|
a.inset_0,
|
||||||
a.z_10,
|
a.z_10,
|
||||||
a.align_center,
|
a.align_center,
|
||||||
gtMobile ? a.p_lg : a.p_md,
|
gtMobile ? a.p_5xl : a.p_xl,
|
||||||
{overflowY: 'auto'},
|
{overflowY: 'auto'},
|
||||||
]}>
|
]}>
|
||||||
<Backdrop />
|
<Backdrop />
|
||||||
@@ -124,7 +125,9 @@ export function Outer({
|
|||||||
style={[
|
style={[
|
||||||
a.w_full,
|
a.w_full,
|
||||||
a.z_20,
|
a.z_20,
|
||||||
a.justify_center,
|
webOptions?.alignTop
|
||||||
|
? undefined
|
||||||
|
: a.justify_center,
|
||||||
a.align_center,
|
a.align_center,
|
||||||
{
|
{
|
||||||
minHeight: web('calc(90vh - 36px)') || undefined,
|
minHeight: web('calc(90vh - 36px)') || undefined,
|
||||||
|
|||||||
@@ -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?: {
|
||||||
|
alignTop?: boolean
|
||||||
|
}
|
||||||
testID?: string
|
testID?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {ReportDialogProps} from './types'
|
|||||||
|
|
||||||
export function ReportDialog(props: ReportDialogProps) {
|
export function ReportDialog(props: ReportDialogProps) {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={props.control}>
|
<Dialog.Outer webOptions={{alignTop: true}} control={props.control}>
|
||||||
<Dialog.Handle />
|
<Dialog.Handle />
|
||||||
<ReportDialogInner {...props} />
|
<ReportDialogInner {...props} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
|
|||||||
Reference in New Issue
Block a user