diff --git a/src/screens/Login/FormContainer.tsx b/src/screens/Login/FormContainer.tsx index e28b48b402..0144a8b5bf 100644 --- a/src/screens/Login/FormContainer.tsx +++ b/src/screens/Login/FormContainer.tsx @@ -1,13 +1,6 @@ import React from 'react' -import { - ScrollView, - type StyleProp, - StyleSheet, - View, - type ViewStyle, -} from 'react-native' +import {type StyleProp, View, type ViewStyle} from 'react-native' -import {isWeb} from '#/platform/detection' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Text} from '#/components/Typography' @@ -16,38 +9,24 @@ export function FormContainer({ title, children, style, - contentContainerStyle, }: { testID?: string title?: React.ReactNode children: React.ReactNode style?: StyleProp - contentContainerStyle?: StyleProp }) { const {gtMobile} = useBreakpoints() const t = useTheme() return ( - - - {title && !gtMobile && ( - - {title} - - )} - {children} - - + style={[a.gap_md, a.flex_1, !gtMobile && [a.px_lg, a.py_md], style]}> + {title && !gtMobile && ( + + {title} + + )} + {children} + ) } - -const styles = StyleSheet.create({ - maxHeight: { - // @ts-ignore web only -prf - maxHeight: isWeb ? '100vh' : undefined, - height: !isWeb ? '100%' : undefined, - }, -}) diff --git a/src/screens/Login/index.tsx b/src/screens/Login/index.tsx index 49f7518b0d..1fce63d298 100644 --- a/src/screens/Login/index.tsx +++ b/src/screens/Login/index.tsx @@ -164,7 +164,11 @@ export const Login = ({onPressBack}: {onPressBack: () => void}) => { return ( - + {content} diff --git a/src/screens/Signup/StepCaptcha/index.tsx b/src/screens/Signup/StepCaptcha/index.tsx index 311c697e7b..2429b0c5e9 100644 --- a/src/screens/Signup/StepCaptcha/index.tsx +++ b/src/screens/Signup/StepCaptcha/index.tsx @@ -1,11 +1,10 @@ import React from 'react' -import {ActivityIndicator, StyleSheet, View} from 'react-native' +import {ActivityIndicator, View} from 'react-native' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {nanoid} from 'nanoid/non-secure' import {createFullHandle} from '#/lib/strings/handles' -import {isWeb} from '#/platform/detection' import {ScreenTransition} from '#/screens/Login/ScreenTransition' import {useSignupContext, useSubmitSignup} from '#/screens/Signup/state' import {CaptchaWebView} from '#/screens/Signup/StepCaptcha/CaptchaWebView' @@ -54,7 +53,14 @@ export function StepCaptcha() { return ( - + {!completed ? ( ) } - -const styles = StyleSheet.create({ - error: { - borderRadius: 6, - marginTop: 10, - }, - // @ts-expect-error: Suppressing error due to incomplete `ViewStyle` type definition in react-native-web, missing `cursor` prop as discussed in https://github.com/necolas/react-native-web/issues/832. - touchable: { - ...(isWeb && {cursor: 'pointer'}), - }, - container: { - minHeight: 500, - width: '100%', - paddingBottom: 20, - overflow: 'hidden', - }, - center: { - alignItems: 'center', - justifyContent: 'center', - }, -}) diff --git a/src/screens/Signup/index.tsx b/src/screens/Signup/index.tsx index b84f4d0d76..4211194c71 100644 --- a/src/screens/Signup/index.tsx +++ b/src/screens/Signup/index.tsx @@ -1,5 +1,6 @@ import React from 'react' -import {ScrollView, View} from 'react-native' +import {View} from 'react-native' +import {LayoutAnimationConfig} from 'react-native-reanimated' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -20,7 +21,7 @@ import { import {StepCaptcha} from '#/screens/Signup/StepCaptcha' import {StepHandle} from '#/screens/Signup/StepHandle' import {StepInfo} from '#/screens/Signup/StepInfo' -import {atoms as a, useTheme} from '#/alf' +import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Button, ButtonText} from '#/components/Button' import {Divider} from '#/components/Divider' import {InlineLink} from '#/components/Link' @@ -32,6 +33,7 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { const {screen} = useAnalytics() const [state, dispatch] = React.useReducer(reducer, initialState) const submit = useSubmitSignup({state, dispatch}) + const {gtMobile} = useBreakpoints() const { data: serviceInfo, @@ -125,13 +127,16 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { - - + description={_(msg`We're so excited to have you join us!`)} + scrollable> + + Step {state.activeStep + 1} of{' '} @@ -152,13 +157,15 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { - {state.activeStep === SignupStep.INFO ? ( - - ) : state.activeStep === SignupStep.HANDLE ? ( - - ) : ( - - )} + + {state.activeStep === SignupStep.INFO ? ( + + ) : state.activeStep === SignupStep.HANDLE ? ( + + ) : ( + + )} + @@ -208,7 +215,7 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { - + ) diff --git a/src/view/com/util/layouts/LoggedOutLayout.tsx b/src/view/com/util/layouts/LoggedOutLayout.tsx index 9424a7154b..0272a44c6b 100644 --- a/src/view/com/util/layouts/LoggedOutLayout.tsx +++ b/src/view/com/util/layouts/LoggedOutLayout.tsx @@ -1,19 +1,24 @@ import React from 'react' -import {StyleSheet, View} from 'react-native' -import {Text} from '../text/Text' +import {ScrollView, StyleSheet, View} from 'react-native' + +import {isWeb} from '#/platform/detection' +import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle' import {usePalette} from 'lib/hooks/usePalette' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' -import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle' +import {atoms as a} from '#/alf' +import {Text} from '../text/Text' export const LoggedOutLayout = ({ leadin, title, description, children, + scrollable, }: React.PropsWithChildren<{ leadin: string title: string description: string + scrollable?: boolean }>) => { const {isMobile, isTabletOrMobile} = useWebMediaQueries() const pal = usePalette('default') @@ -25,7 +30,18 @@ export const LoggedOutLayout = ({ }) if (isMobile) { - return {children} + if (scrollable) { + return ( + + {children} + + ) + } else { + return {children} + } } return ( @@ -50,9 +66,23 @@ export const LoggedOutLayout = ({ {description} - - {children} - + {scrollable ? ( + + + + {children} + + + + ) : ( + + {children} + + )} ) } @@ -74,7 +104,16 @@ const styles = StyleSheet.create({ paddingHorizontal: 40, justifyContent: 'center', }, - + scrollableContent: { + flex: 2, + }, + scrollview: { + flex: 1, + }, + scrollViewContentContainer: { + flex: 1, + paddingHorizontal: 40, + }, leadinText: { fontSize: 36, fontWeight: '800',