-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: working onboarding flow (#135)
Signed-off-by: Timo Glastra <[email protected]>
- Loading branch information
1 parent
a0f2835
commit e0363e7
Showing
66 changed files
with
1,372 additions
and
275 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
apps/funke/agent/initialize.ts → apps/funke/src/agent/initialize.ts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
apps/funke/app/(app)/_layout.tsx → apps/funke/src/app/(app)/_layout.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
File renamed without changes.
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,24 @@ | ||
import { WalletScreen } from '@package/app' | ||
import { XStack } from '@package/ui' | ||
import { Stack } from 'expo-router' | ||
import { useSafeAreaInsets } from 'react-native-safe-area-context' | ||
import inAppLogo from '../../../assets/in-app-logo.png' | ||
|
||
export default function Screen() { | ||
const { top } = useSafeAreaInsets() | ||
|
||
return ( | ||
<> | ||
<Stack.Screen | ||
options={{ | ||
headerShown: true, | ||
title: 'Home', | ||
header: () => { | ||
return <XStack h={top} bg="$background" /> | ||
}, | ||
}} | ||
/> | ||
<WalletScreen logo={inAppLogo} showInbox={false} /> | ||
</> | ||
) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,16 @@ | ||
import { OnboardingContextProvider } from '@funke/features/onboarding' | ||
import { Slot } from 'expo-router' | ||
import * as SplashScreen from 'expo-splash-screen' | ||
import { useResetWalletDevMenu } from '../../utils/resetWallet' | ||
|
||
export default function RootLayout() { | ||
useResetWalletDevMenu() | ||
|
||
void SplashScreen.hideAsync() | ||
|
||
return ( | ||
<OnboardingContextProvider> | ||
<Slot /> | ||
</OnboardingContextProvider> | ||
) | ||
} |
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,43 @@ | ||
import { useOnboardingContext } from '@funke/features/onboarding' | ||
import { FlexPage, OnboardingScreensHeader } from '@package/ui' | ||
import Animated, { FadeInRight, FadeOutLeft } from 'react-native-reanimated' | ||
|
||
export default function OnboardingScreens() { | ||
const onboardingContext = useOnboardingContext() | ||
|
||
let page: React.JSX.Element | ||
if (onboardingContext.page.type === 'fullscreen') { | ||
page = onboardingContext.screen | ||
} else { | ||
page = ( | ||
<FlexPage gap="$0"> | ||
<OnboardingScreensHeader | ||
flex={1} | ||
progress={onboardingContext.progress} | ||
title={onboardingContext.page.title} | ||
subtitle={onboardingContext.page.subtitle} | ||
/> | ||
<Animated.View | ||
key={onboardingContext.page.animationKey ?? onboardingContext.currentStep} | ||
style={{ flex: 3 }} | ||
entering={FadeInRight} | ||
exiting={FadeOutLeft} | ||
> | ||
{onboardingContext.screen} | ||
</Animated.View> | ||
</FlexPage> | ||
) | ||
} | ||
|
||
return ( | ||
<Animated.View | ||
// for full screen, we want to animate the page transitions. For others we don't want to animate the static layout for every page change | ||
key={onboardingContext.page.type === 'fullscreen' ? onboardingContext.currentStep : onboardingContext.page.type} | ||
style={{ flex: 1 }} | ||
entering={FadeInRight} | ||
exiting={FadeOutLeft} | ||
> | ||
{page} | ||
</Animated.View> | ||
) | ||
} |
File renamed without changes.
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,4 +1,4 @@ | ||
import { FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID } from '@funke/constants' | ||
import { aes128Gcm } from '@package/agent' | ||
import { FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID } from '../constants' | ||
|
||
export const funkeAes128Gcm = aes128Gcm(FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID) |
File renamed without changes.
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 @@ | ||
export * from './onboardingContext' |
Oops, something went wrong.