diff options
author | Eric Bailey <git@esb.lol> | 2023-11-21 16:58:13 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-21 16:58:13 -0600 |
commit | 47d2d3cbf289ebb2e893e07b5265aad8fcd64cb1 (patch) | |
tree | 240fa451bea159796c25180bc0501a6190c6c629 /src/view/shell/NavSignupCard.tsx | |
parent | 4c4ba553bdc4029e78eaf2ccf0f9df12e41a1b01 (diff) | |
download | voidsky-47d2d3cbf289ebb2e893e07b5265aad8fcd64cb1.tar.zst |
[PWI] Shell (#1967)
* Sidebars * Bottom bar * Drawer * Translate * Spacing fix * Fix responsive regression * Fix nit
Diffstat (limited to 'src/view/shell/NavSignupCard.tsx')
-rw-r--r-- | src/view/shell/NavSignupCard.tsx | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/view/shell/NavSignupCard.tsx b/src/view/shell/NavSignupCard.tsx new file mode 100644 index 000000000..7026dd2a6 --- /dev/null +++ b/src/view/shell/NavSignupCard.tsx @@ -0,0 +1,61 @@ +import React from 'react' +import {View} from 'react-native' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' + +import {s} from 'lib/styles' +import {usePalette} from 'lib/hooks/usePalette' +import {DefaultAvatar} from '#/view/com/util/UserAvatar' +import {Text} from '#/view/com/util/text/Text' +import {Button} from '#/view/com/util/forms/Button' +import {useLoggedOutViewControls} from '#/state/shell/logged-out' +import {useCloseAllActiveElements} from '#/state/util' + +export function NavSignupCard() { + const {_} = useLingui() + const pal = usePalette('default') + const {setShowLoggedOut} = useLoggedOutViewControls() + const closeAllActiveElements = useCloseAllActiveElements() + + const showLoggedOut = React.useCallback(() => { + closeAllActiveElements() + setShowLoggedOut(true) + }, [setShowLoggedOut, closeAllActiveElements]) + + return ( + <View + style={{ + alignItems: 'flex-start', + paddingTop: 6, + marginBottom: 24, + }}> + <DefaultAvatar type="user" size={48} /> + + <View style={{paddingTop: 12}}> + <Text type="md" style={[pal.text, s.bold]}> + <Trans>Sign up or sign in to join the conversation</Trans> + </Text> + </View> + + <View style={{flexDirection: 'row', paddingTop: 12, gap: 8}}> + <Button + onPress={showLoggedOut} + accessibilityHint={_(msg`Sign up`)} + accessibilityLabel={_(msg`Sign up`)}> + <Text type="md" style={[{color: 'white'}, s.bold]}> + <Trans>Sign up</Trans> + </Text> + </Button> + <Button + type="default" + onPress={showLoggedOut} + accessibilityHint={_(msg`Sign in`)} + accessibilityLabel={_(msg`Sign in`)}> + <Text type="md" style={[pal.text, s.bold]}> + Sign in + </Text> + </Button> + </View> + </View> + ) +} |