Compare commits

..

2 Commits

Author SHA1 Message Date
Ducky ef1a25c8c4 Zio Blue: revert commit e0cafb20d6. 2024-09-03 19:21:06 +01:00
Ducky fce6f31006 Zio Blue: revert d449fc1ced. 2024-09-03 19:20:55 +01:00
2 changed files with 32 additions and 2 deletions

View File

@ -49,7 +49,7 @@ const ControlsContext = React.createContext<Controls>({
export function Provider({children}: React.PropsWithChildren<{}>) { export function Provider({children}: React.PropsWithChildren<{}>) {
const activeStarterPack = useActiveStarterPack() const activeStarterPack = useActiveStarterPack()
const {hasSession} = useSession() const {hasSession} = useSession()
const shouldShowStarterPack = false const shouldShowStarterPack = Boolean(activeStarterPack?.uri) && !hasSession
const [state, setState] = React.useState<State>({ const [state, setState] = React.useState<State>({
showLoggedOut: shouldShowStarterPack, showLoggedOut: shouldShowStarterPack,
requestedAccountSwitchTo: shouldShowStarterPack requestedAccountSwitchTo: shouldShowStarterPack

View File

@ -24,6 +24,7 @@ enum ScreenState {
S_LoginOrCreateAccount, S_LoginOrCreateAccount,
S_Login, S_Login,
S_CreateAccount, S_CreateAccount,
S_StarterPack,
} }
export {ScreenState as LoggedOutScreenState} export {ScreenState as LoggedOutScreenState}
@ -36,6 +37,8 @@ export function LoggedOut({onDismiss}: {onDismiss?: () => void}) {
const [screenState, setScreenState] = React.useState<ScreenState>(() => { const [screenState, setScreenState] = React.useState<ScreenState>(() => {
if (requestedAccountSwitchTo === 'new') { if (requestedAccountSwitchTo === 'new') {
return ScreenState.S_CreateAccount return ScreenState.S_CreateAccount
} else if (requestedAccountSwitchTo === 'starterpack') {
return ScreenState.S_StarterPack
} else if (requestedAccountSwitchTo != null) { } else if (requestedAccountSwitchTo != null) {
return ScreenState.S_Login return ScreenState.S_Login
} else { } else {
@ -59,7 +62,34 @@ export function LoggedOut({onDismiss}: {onDismiss?: () => void}) {
return ( return (
<View testID="noSessionView" style={[s.hContentRegion, pal.view]}> <View testID="noSessionView" style={[s.hContentRegion, pal.view]}>
<ErrorBoundary> <ErrorBoundary>
{screenState === ScreenState.S_LoginOrCreateAccount ? ( {onDismiss && screenState === ScreenState.S_LoginOrCreateAccount ? (
<Pressable
accessibilityHint={_(msg`Go back`)}
accessibilityLabel={_(msg`Go back`)}
accessibilityRole="button"
style={{
position: 'absolute',
top: isIOS ? 0 : 20,
right: 20,
padding: 10,
zIndex: 100,
backgroundColor: pal.text.color,
borderRadius: 100,
}}
onPress={onPressDismiss}>
<FontAwesomeIcon
icon="x"
size={12}
style={{
color: String(pal.textInverted.color),
}}
/>
</Pressable>
) : null}
{screenState === ScreenState.S_StarterPack ? (
<LandingScreen setScreenState={setScreenState} />
) : screenState === ScreenState.S_LoginOrCreateAccount ? (
<SplashScreen <SplashScreen
onPressSignin={() => { onPressSignin={() => {
setScreenState(ScreenState.S_Login) setScreenState(ScreenState.S_Login)