-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile): handle initial route, closes leather-io/issues#60
- Loading branch information
1 parent
b9f14dc
commit 5c249f6
Showing
13 changed files
with
96 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,7 @@ dist | |
build | ||
tsconfig.tsbuildinfo | ||
.turbo/ | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
leather-styles | ||
**/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Stack } from 'expo-router'; | ||
|
||
export function Root() { | ||
return <Stack initialRouteName="waiting-list/index" />; | ||
return <Stack />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { useRouter } from 'expo-router'; | ||
|
||
import { WaitingList as WaitingListLayout } from './waiting-list-layout'; | ||
import { WaitingList } from './waiting-list'; | ||
|
||
export default function WaitingList() { | ||
export default function WaitingListPage() { | ||
const router = useRouter(); | ||
return <WaitingListLayout onHiddenPressAction={() => router.replace('/')} />; | ||
return <WaitingList onHiddenPressAction={() => router.replace('/')} />; | ||
} |
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
apps/mobile/src/components/splash-screen-guard/splash-screen-guard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useState } from 'react'; | ||
|
||
import { Box } from '@leather.io/ui/native'; | ||
|
||
import { LeatherSplash } from '../animations/leather-splash'; | ||
|
||
interface SplashScreenGuardProps { | ||
children: React.ReactNode; | ||
} | ||
export function SplashScreenGuard({ children }: SplashScreenGuardProps) { | ||
const [animationFinished, setAnimationFinished] = useState(false); | ||
|
||
if (!animationFinished) { | ||
return ( | ||
<Box backgroundColor="base.ink.component-background-default" flex={1}> | ||
<LeatherSplash onAnimationEnd={() => setAnimationFinished(true)} /> | ||
</Box> | ||
); | ||
} | ||
|
||
return children; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const appStartModes = ['prelaunch', 'live'] as const; | ||
|
||
export type AppStartMode = (typeof appStartModes)[number]; | ||
|
||
type AppStartModeMap<T = any> = Record<AppStartMode, T>; | ||
|
||
export function whenAppStartMode<K extends AppStartMode>(mode: K) { | ||
if (!appStartModes.includes(mode)) | ||
throw new Error('App start mode must be one of: ' + appStartModes.join(', ')); | ||
|
||
return <M extends AppStartModeMap>(appStartModeMap: M): M[K] => appStartModeMap[mode]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters