Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778import {memo, useCallback} from 'react'import {View} from 'react-native'import {msg} from '@lingui/core/macro'import {useLingui} from '@lingui/react'import {Trans} from '@lingui/react/macro'
import {useBrand} from '#/lib/community/BrandContext'import {useLoggedOutViewControls} from '#/state/shell/logged-out'import {useCloseAllActiveElements} from '#/state/util'import {Logo} from '#/view/icons/Logo'import {atoms as a} from '#/alf'import {AppLanguageDropdown} from '#/components/AppLanguageDropdown'import {Button, ButtonText} from '#/components/Button'import {Link} from '#/components/Link'import {Text} from '#/components/Typography'
let NavSignupCard = ({}: {}): React.ReactNode => { const {_} = useLingui() const brand = useBrand() const {requestSwitchToAccount} = useLoggedOutViewControls() const closeAllActiveElements = useCloseAllActiveElements()
const showSignIn = useCallback(() => { closeAllActiveElements() requestSwitchToAccount({requestedAccount: 'none'}) }, [requestSwitchToAccount, closeAllActiveElements])
const showCreateAccount = useCallback(() => { closeAllActiveElements() requestSwitchToAccount({requestedAccount: 'new'}) // setShowLoggedOut(true) }, [requestSwitchToAccount, closeAllActiveElements])
return ( <View style={[{maxWidth: 245}]}> <Link to="/" label={`${brand.web.title} - Home`}> <Logo width={32} /> </Link>
<View style={[a.pt_lg]}> <Text style={[a.text_3xl, a.font_bold, {lineHeight: a.text_3xl.fontSize}]}> {brand.messages.primaryCTA} </Text> </View>
<View style={[a.flex_row, a.flex_wrap, a.gap_sm, a.pt_md]}> <Button onPress={showCreateAccount} label={_(msg`Create account`)} size="small" variant="solid" color="primary"> <ButtonText> <Trans>Create account</Trans> </ButtonText> </Button> <Button onPress={showSignIn} label={_(msg`Sign in`)} size="small" variant="solid" color="secondary"> <ButtonText> <Trans>Sign in</Trans> </ButtonText> </Button> </View>
<View style={[a.mt_md, a.w_full, {height: 32}]}> <AppLanguageDropdown /> </View> </View> )}NavSignupCard = memo(NavSignupCard)export {NavSignupCard}