use native modal for queue screen
This commit is contained in:
@@ -1,16 +1,17 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {View} from 'react-native'
|
import {Modal, View} from 'react-native'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
|
import {StatusBar} from 'expo-status-bar'
|
||||||
import {msg, plural, Trans} from '@lingui/macro'
|
import {msg, plural, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isIOS, isWeb} from '#/platform/detection'
|
||||||
import {isSignupQueued, useAgent, useSessionApi} from '#/state/session'
|
import {isSignupQueued, useAgent, useSessionApi} from '#/state/session'
|
||||||
import {useOnboardingDispatch} from '#/state/shell'
|
import {useOnboardingDispatch} from '#/state/shell'
|
||||||
import {ScrollView} from '#/view/com/util/Views'
|
import {ScrollView} from '#/view/com/util/Views'
|
||||||
import {Logo} from '#/view/icons/Logo'
|
import {Logo} from '#/view/icons/Logo'
|
||||||
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
import {atoms as a, native, useBreakpoints, useTheme, web} from '#/alf'
|
||||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
import {P, Text} from '#/components/Typography'
|
import {P, Text} from '#/components/Typography'
|
||||||
@@ -86,19 +87,21 @@ export function SignupQueued() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<Modal
|
||||||
aria-modal
|
visible
|
||||||
role="dialog"
|
animationType={native('slide')}
|
||||||
aria-role="dialog"
|
presentationStyle="formSheet"
|
||||||
aria-label={_(msg`You're in line`)}
|
style={[web(a.util_screen_outer)]}>
|
||||||
accessibilityLabel={_(msg`You're in line`)}
|
{isIOS && <StatusBar style="light" />}
|
||||||
accessibilityHint=""
|
|
||||||
style={[a.absolute, a.inset_0, a.flex_1, t.atoms.bg]}>
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
style={[a.h_full, a.w_full, {paddingTop: insets.top}]}
|
style={[a.flex_1, t.atoms.bg]}
|
||||||
contentContainerStyle={{borderWidth: 0}}>
|
contentContainerStyle={{borderWidth: 0}}>
|
||||||
<View
|
<View
|
||||||
style={[a.flex_row, a.justify_center, gtMobile ? a.pt_4xl : a.px_xl]}>
|
style={[
|
||||||
|
a.flex_row,
|
||||||
|
a.justify_center,
|
||||||
|
gtMobile ? a.pt_4xl : [a.px_xl, a.pt_xl],
|
||||||
|
]}>
|
||||||
<View style={[a.flex_1, {maxWidth: COL_WIDTH}]}>
|
<View style={[a.flex_1, {maxWidth: COL_WIDTH}]}>
|
||||||
<View
|
<View
|
||||||
style={[a.w_full, a.justify_center, a.align_center, a.my_4xl]}>
|
style={[a.w_full, a.justify_center, a.align_center, a.my_4xl]}>
|
||||||
@@ -121,11 +124,13 @@ export function SignupQueued() {
|
|||||||
a.px_2xl,
|
a.px_2xl,
|
||||||
a.py_4xl,
|
a.py_4xl,
|
||||||
a.mt_2xl,
|
a.mt_2xl,
|
||||||
t.atoms.bg_contrast_50,
|
a.border,
|
||||||
|
t.atoms.bg_contrast_25,
|
||||||
|
t.atoms.border_contrast_medium,
|
||||||
]}>
|
]}>
|
||||||
{typeof placeInQueue === 'number' && (
|
{typeof placeInQueue === 'number' && (
|
||||||
<Text
|
<Text
|
||||||
style={[a.text_5xl, a.text_center, a.font_bold, a.mb_2xl]}>
|
style={[a.text_5xl, a.text_center, a.font_heavy, a.mb_2xl]}>
|
||||||
{placeInQueue}
|
{placeInQueue}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
@@ -148,7 +153,14 @@ export function SignupQueued() {
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
{isWeb && gtMobile && (
|
{isWeb && gtMobile && (
|
||||||
<View style={[a.w_full, a.flex_row, a.justify_between, a.pt_5xl]}>
|
<View
|
||||||
|
style={[
|
||||||
|
a.w_full,
|
||||||
|
a.flex_row,
|
||||||
|
a.justify_between,
|
||||||
|
a.pt_5xl,
|
||||||
|
{paddingBottom: 200},
|
||||||
|
]}>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="large"
|
size="large"
|
||||||
@@ -162,8 +174,6 @@ export function SignupQueued() {
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={{height: 200}} />
|
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
@@ -171,6 +181,7 @@ export function SignupQueued() {
|
|||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.align_center,
|
a.align_center,
|
||||||
|
t.atoms.bg,
|
||||||
gtMobile ? a.px_5xl : a.px_xl,
|
gtMobile ? a.px_5xl : a.px_xl,
|
||||||
{
|
{
|
||||||
paddingBottom: Math.max(insets.bottom, a.pb_5xl.paddingBottom),
|
paddingBottom: Math.max(insets.bottom, a.pb_5xl.paddingBottom),
|
||||||
@@ -190,7 +201,7 @@ export function SignupQueued() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</Modal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user