-
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.
Signed-off-by: Timo Glastra <[email protected]>
- Loading branch information
1 parent
c6b10db
commit 7199219
Showing
5 changed files
with
78 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { FunkeMenuScreen } from '@easypid/features/wallet/FunkeMenuScreen' | ||
|
||
export default function Screen() { | ||
return <FunkeMenuScreen /> | ||
} |
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,60 @@ | ||
import { Button, Heading, ScrollView, Spacer, YStack } from '@package/ui' | ||
import React from 'react' | ||
import { useRouter } from 'solito/router' | ||
|
||
import { useScrollViewPosition } from '@package/app/src/hooks' | ||
|
||
import { useSecureUnlock } from '@easypid/agent' | ||
import { Alert } from 'react-native' | ||
import { useSafeAreaInsets } from 'react-native-safe-area-context' | ||
import { resetWallet } from '../../utils/resetWallet' | ||
|
||
export function FunkeMenuScreen() { | ||
const { handleScroll, isScrolledByOffset, scrollEventThrottle } = useScrollViewPosition() | ||
const secureUnlock = useSecureUnlock() | ||
const router = useRouter() | ||
const { bottom } = useSafeAreaInsets() | ||
|
||
const onResetWallet = () => { | ||
Alert.alert('Reset Wallet', 'Are you sure you want to reset the wallet?', [ | ||
{ | ||
text: 'Cancel', | ||
style: 'cancel', | ||
}, | ||
{ | ||
text: 'Yes', | ||
onPress: () => { | ||
resetWallet(secureUnlock) | ||
router.replace('/onboarding') | ||
}, | ||
}, | ||
]) | ||
} | ||
|
||
return ( | ||
<YStack bg="$background" height="100%"> | ||
{/* This is the header where the scroll view get's behind. We have the same content in the scrollview, but you | ||
* don't see that content. It's just so we can make the scrollview minheight 100%. */} | ||
<YStack zIndex={2} w="100%" top={0} position="absolute"> | ||
<Spacer size="$13" w="100%" backgroundColor="$background" /> | ||
<YStack borderWidth={0.5} borderColor={isScrolledByOffset ? '$grey-300' : '$background'} /> | ||
</YStack> | ||
<ScrollView | ||
onScroll={handleScroll} | ||
scrollEventThrottle={scrollEventThrottle} | ||
contentContainerStyle={{ minHeight: '100%' }} | ||
> | ||
<Spacer size="$13" /> | ||
<YStack borderWidth={0.5} borderColor="$background" /> | ||
<YStack gap="$6" p="$4" flex-1 justifyContent="space-between" paddingBottom={bottom}> | ||
<YStack gap="$6"> | ||
<Heading variant="title" fontWeight="$bold"> | ||
Menu | ||
</Heading> | ||
</YStack> | ||
<Button.Solid onPress={onResetWallet}>Reset Wallet</Button.Solid> | ||
</YStack> | ||
</ScrollView> | ||
</YStack> | ||
) | ||
} |
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