Hack a footer into the logged out view
This commit is contained in:
@@ -6,7 +6,6 @@ import {AppBskyGraphStarterpack} from '@atproto/api'
|
|||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {FEEDBACK_FORM_URL} from '#/lib/constants'
|
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useServiceQuery} from '#/state/queries/service'
|
import {useServiceQuery} from '#/state/queries/service'
|
||||||
import {useStarterPackQuery} from '#/state/queries/starter-packs'
|
import {useStarterPackQuery} from '#/state/queries/starter-packs'
|
||||||
@@ -22,11 +21,8 @@ import {
|
|||||||
import {StepCaptcha} from '#/screens/Signup/StepCaptcha'
|
import {StepCaptcha} from '#/screens/Signup/StepCaptcha'
|
||||||
import {StepHandle} from '#/screens/Signup/StepHandle'
|
import {StepHandle} from '#/screens/Signup/StepHandle'
|
||||||
import {StepInfo} from '#/screens/Signup/StepInfo'
|
import {StepInfo} from '#/screens/Signup/StepInfo'
|
||||||
import {atoms as a, native, useBreakpoints, useTheme} from '#/alf'
|
import {atoms as a, native, useTheme} from '#/alf'
|
||||||
import {AppLanguageDropdown} from '#/components/AppLanguageDropdown'
|
|
||||||
import {Divider} from '#/components/Divider'
|
|
||||||
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
import {LinearGradientBackground} from '#/components/LinearGradientBackground'
|
||||||
import {InlineLinkText} from '#/components/Link'
|
|
||||||
import {ScreenTransition} from '#/components/ScreenTransition'
|
import {ScreenTransition} from '#/components/ScreenTransition'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {useAnalytics} from '#/analytics'
|
import {useAnalytics} from '#/analytics'
|
||||||
@@ -41,7 +37,6 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
|||||||
...initialState,
|
...initialState,
|
||||||
analytics: ax,
|
analytics: ax,
|
||||||
})
|
})
|
||||||
const {gtMobile} = useBreakpoints()
|
|
||||||
const submit = useSubmitSignup()
|
const submit = useSubmitSignup()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -167,13 +162,7 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
|||||||
<ScreenTransition
|
<ScreenTransition
|
||||||
key={state.activeStep}
|
key={state.activeStep}
|
||||||
direction={state.screenTransitionDirection}>
|
direction={state.screenTransitionDirection}>
|
||||||
<View
|
<View style={[a.flex_1, a.px_xl, a.pt_2xl]}>
|
||||||
style={[
|
|
||||||
a.flex_1,
|
|
||||||
a.px_xl,
|
|
||||||
a.pt_2xl,
|
|
||||||
!gtMobile && {paddingBottom: 100},
|
|
||||||
]}>
|
|
||||||
<View style={[a.gap_sm, a.pb_3xl]}>
|
<View style={[a.gap_sm, a.pb_3xl]}>
|
||||||
<Text
|
<Text
|
||||||
style={[a.font_semi_bold, t.atoms.text_contrast_medium]}>
|
style={[a.font_semi_bold, t.atoms.text_contrast_medium]}>
|
||||||
@@ -210,33 +199,6 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
|||||||
) : (
|
) : (
|
||||||
<StepCaptcha />
|
<StepCaptcha />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
<View
|
|
||||||
style={[
|
|
||||||
a.w_full,
|
|
||||||
a.py_lg,
|
|
||||||
a.flex_row,
|
|
||||||
a.gap_md,
|
|
||||||
a.align_center,
|
|
||||||
]}>
|
|
||||||
<AppLanguageDropdown />
|
|
||||||
<Text
|
|
||||||
style={[
|
|
||||||
a.flex_1,
|
|
||||||
t.atoms.text_contrast_medium,
|
|
||||||
!gtMobile && a.text_md,
|
|
||||||
]}>
|
|
||||||
<Trans>Having trouble?</Trans>{' '}
|
|
||||||
<InlineLinkText
|
|
||||||
label={_(msg`Contact support`)}
|
|
||||||
to={FEEDBACK_FORM_URL({email: state.email})}
|
|
||||||
style={[!gtMobile && a.text_md]}>
|
|
||||||
<Trans>Contact support</Trans>
|
|
||||||
</InlineLinkText>
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
</ScreenTransition>
|
</ScreenTransition>
|
||||||
</LayoutAnimationConfig>
|
</LayoutAnimationConfig>
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
import {ScrollView, StyleSheet, View} from 'react-native'
|
import {ScrollView, StyleSheet, View} from 'react-native'
|
||||||
|
import {msg, Trans} from '@lingui/macro'
|
||||||
|
import {useLingui} from '@lingui/react'
|
||||||
import type React from 'react'
|
import type React from 'react'
|
||||||
|
|
||||||
|
import {FEEDBACK_FORM_URL} from '#/lib/constants'
|
||||||
import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle'
|
import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle'
|
||||||
import {useIsKeyboardVisible} from '#/lib/hooks/useIsKeyboardVisible'
|
import {useIsKeyboardVisible} from '#/lib/hooks/useIsKeyboardVisible'
|
||||||
import {usePalette} from '#/lib/hooks/usePalette'
|
import {usePalette} from '#/lib/hooks/usePalette'
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {atoms as a} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||||
|
import {AppLanguageDropdown} from '#/components/AppLanguageDropdown'
|
||||||
|
import {Divider} from '#/components/Divider'
|
||||||
|
import {InlineLinkText} from '#/components/Link'
|
||||||
|
import {Text as NewText} from '#/components/Typography'
|
||||||
import {IS_WEB} from '#/env'
|
import {IS_WEB} from '#/env'
|
||||||
import {Text} from '../text/Text'
|
import {Text} from '../text/Text'
|
||||||
|
|
||||||
@@ -21,6 +28,9 @@ export const LoggedOutLayout = ({
|
|||||||
description: string
|
description: string
|
||||||
scrollable?: boolean
|
scrollable?: boolean
|
||||||
}>) => {
|
}>) => {
|
||||||
|
const t = useTheme()
|
||||||
|
const {_} = useLingui()
|
||||||
|
const {gtMobile} = useBreakpoints()
|
||||||
const {isMobile, isTabletOrMobile} = useWebMediaQueries()
|
const {isMobile, isTabletOrMobile} = useWebMediaQueries()
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const sideBg = useColorSchemeStyle(pal.viewLight, pal.view)
|
const sideBg = useColorSchemeStyle(pal.viewLight, pal.view)
|
||||||
@@ -33,6 +43,29 @@ export const LoggedOutLayout = ({
|
|||||||
const [isKeyboardVisible] = useIsKeyboardVisible()
|
const [isKeyboardVisible] = useIsKeyboardVisible()
|
||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
|
const footer = (
|
||||||
|
<View style={[a.px_lg]}>
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<View style={[a.w_full, a.py_lg, a.flex_row, a.gap_md, a.align_center]}>
|
||||||
|
<AppLanguageDropdown />
|
||||||
|
<NewText
|
||||||
|
style={[
|
||||||
|
a.flex_1,
|
||||||
|
t.atoms.text_contrast_medium,
|
||||||
|
!gtMobile && a.text_md,
|
||||||
|
]}>
|
||||||
|
<Trans>Having trouble?</Trans>{' '}
|
||||||
|
<InlineLinkText
|
||||||
|
label={_(msg`Contact support`)}
|
||||||
|
to={FEEDBACK_FORM_URL({})}
|
||||||
|
style={[!gtMobile && a.text_md]}>
|
||||||
|
<Trans>Contact support</Trans>
|
||||||
|
</InlineLinkText>
|
||||||
|
</NewText>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
if (scrollable) {
|
if (scrollable) {
|
||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
@@ -43,10 +76,16 @@ export const LoggedOutLayout = ({
|
|||||||
{paddingBottom: isKeyboardVisible ? 300 : 0},
|
{paddingBottom: isKeyboardVisible ? 300 : 0},
|
||||||
]}>
|
]}>
|
||||||
<View style={a.pt_md}>{children}</View>
|
<View style={a.pt_md}>{children}</View>
|
||||||
|
{footer}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return <View style={a.pt_md}>{children}</View>
|
return (
|
||||||
|
<>
|
||||||
|
<View style={a.pt_md}>{children}</View>
|
||||||
|
{footer}
|
||||||
|
</>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user