-
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.
- Loading branch information
1 parent
7293564
commit 3a4b659
Showing
41 changed files
with
728 additions
and
113 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
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,107 @@ | ||
import { useRef, useState } from 'react'; | ||
import { ScrollView } from 'react-native-gesture-handler'; | ||
import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
|
||
import { NotifyUserSheet, OptionData } from '@/components/sheets/notify-user-sheet.layout'; | ||
import { Trans, t } from '@lingui/macro'; | ||
import { useTheme } from '@shopify/restyle'; | ||
|
||
import { | ||
Box, | ||
Cell, | ||
LogoHardwareBitkey, | ||
LogoHardwareFoundation, | ||
LogoHardwareLedger, | ||
LogoHardwareOnekey, | ||
LogoHardwareRyder, | ||
LogoHardwareTrezor, | ||
QuestionCircleIcon, | ||
SheetRef, | ||
Text, | ||
Theme, | ||
TouchableOpacity, | ||
} from '@leather.io/ui/native'; | ||
|
||
export default function HardwareWalletsScreen() { | ||
const { bottom } = useSafeAreaInsets(); | ||
const theme = useTheme<Theme>(); | ||
const notifyUserSheetRef = useRef<SheetRef>(null); | ||
const [optionData, setOptionData] = useState<OptionData | null>(null); | ||
function onOpenNotificationsSheet(option: OptionData) { | ||
setOptionData(option); | ||
notifyUserSheetRef.current?.present(); | ||
} | ||
function onCloseNotificationsSheet() { | ||
setOptionData(null); | ||
} | ||
function getUnavailableFeatures() { | ||
const UNAVAILABLE_FEATURES = { | ||
bitgo: { title: t`Bitkey`, Icon: LogoHardwareBitkey }, | ||
capsule: { title: t`Ledger`, Icon: LogoHardwareLedger }, | ||
copper: { title: t`OneKey`, Icon: LogoHardwareOnekey }, | ||
fireblocks: { title: t`Passport`, Icon: LogoHardwareFoundation }, | ||
foredefi: { title: t`Ryder`, Icon: LogoHardwareRyder }, | ||
portal: { title: t`Trezor`, Icon: LogoHardwareTrezor }, | ||
}; | ||
|
||
return UNAVAILABLE_FEATURES; | ||
} | ||
return ( | ||
<> | ||
<Box | ||
flex={1} | ||
backgroundColor="ink.background-primary" | ||
style={{ paddingBottom: bottom + theme.spacing['5'] }} | ||
> | ||
<ScrollView contentContainerStyle={{ paddingHorizontal: theme.spacing['5'] }}> | ||
<Box gap="3" pt="5"> | ||
<TouchableOpacity | ||
onPress={() => { | ||
// TODO: show some kind of a helper here | ||
}} | ||
p="5" | ||
position="absolute" | ||
right={-theme.spacing['5']} | ||
zIndex={10} | ||
top={theme.spacing['1']} | ||
> | ||
<QuestionCircleIcon color={theme.colors['ink.text-primary']} variant="small" /> | ||
</TouchableOpacity> | ||
<Box> | ||
<Trans> | ||
<Text variant="heading03">CONNECT</Text> | ||
<Text variant="heading03">HARDWARE DEVICE</Text> | ||
</Trans> | ||
</Box> | ||
<Box gap="1" pt="5"> | ||
{Object.entries(getUnavailableFeatures()).map(featureEntry => { | ||
const [featureKey, feature] = featureEntry; | ||
const hardwareWalletName = feature.title; | ||
function onPress() { | ||
onOpenNotificationsSheet({ | ||
title: t`Connect hardware wallet: ${hardwareWalletName}`, | ||
id: featureKey, | ||
}); | ||
} | ||
return ( | ||
<Cell | ||
py="4" | ||
key={featureKey} | ||
onPress={onPress} | ||
title={feature.title} | ||
Icon={feature.Icon} | ||
/> | ||
); | ||
})} | ||
</Box> | ||
</Box> | ||
</ScrollView> | ||
</Box> | ||
<NotifyUserSheet | ||
optionData={optionData} | ||
onCloseNotificationsSheet={onCloseNotificationsSheet} | ||
notifyUserSheetRef={notifyUserSheetRef} | ||
/> | ||
</> | ||
); | ||
} |
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,111 @@ | ||
import { useRef, useState } from 'react'; | ||
import { ScrollView } from 'react-native-gesture-handler'; | ||
import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
|
||
import { NotifyUserSheet, OptionData } from '@/components/sheets/notify-user-sheet.layout'; | ||
import { Trans, t } from '@lingui/macro'; | ||
import { useTheme } from '@shopify/restyle'; | ||
|
||
import { | ||
Box, | ||
Cell, | ||
LogoMPCBitgo, | ||
LogoMPCCapsule, | ||
LogoMPCCopper, | ||
LogoMPCFireblocks, | ||
LogoMPCFordefi, | ||
LogoMPCPortal, | ||
LogoMPCPrivy, | ||
LogoMPCQredo, | ||
QuestionCircleIcon, | ||
SheetRef, | ||
Text, | ||
Theme, | ||
TouchableOpacity, | ||
} from '@leather.io/ui/native'; | ||
|
||
export default function MPCWalletsScreen() { | ||
const { bottom } = useSafeAreaInsets(); | ||
const theme = useTheme<Theme>(); | ||
const notifyUserSheetRef = useRef<SheetRef>(null); | ||
const [optionData, setOptionData] = useState<OptionData | null>(null); | ||
function onOpenNotificationsSheet(option: OptionData) { | ||
setOptionData(option); | ||
notifyUserSheetRef.current?.present(); | ||
} | ||
function onCloseNotificationsSheet() { | ||
setOptionData(null); | ||
} | ||
function getUnavailableFeatures() { | ||
const UNAVAILABLE_FEATURES = { | ||
bitgo: { title: t`BitGo`, Icon: LogoMPCBitgo }, | ||
capsule: { title: t`Capsule`, Icon: LogoMPCCapsule }, | ||
copper: { title: t`Copper`, Icon: LogoMPCCopper }, | ||
fireblocks: { title: t`Fireblocks`, Icon: LogoMPCFireblocks }, | ||
foredefi: { title: t`Foredefi`, Icon: LogoMPCFordefi }, | ||
portal: { title: t`Portal`, Icon: LogoMPCPortal }, | ||
privy: { title: t`Privy`, Icon: LogoMPCPrivy }, | ||
qredo: { title: t`Qredo`, Icon: LogoMPCQredo }, | ||
}; | ||
|
||
return UNAVAILABLE_FEATURES; | ||
} | ||
return ( | ||
<> | ||
<Box | ||
flex={1} | ||
backgroundColor="ink.background-primary" | ||
style={{ paddingBottom: bottom + theme.spacing['5'] }} | ||
> | ||
<ScrollView contentContainerStyle={{ paddingHorizontal: theme.spacing['5'] }}> | ||
<Box gap="3" pt="5"> | ||
<TouchableOpacity | ||
onPress={() => { | ||
// TODO: show some kind of a helper here | ||
}} | ||
p="5" | ||
position="absolute" | ||
right={-theme.spacing['5']} | ||
zIndex={10} | ||
top={theme.spacing['1']} | ||
> | ||
<QuestionCircleIcon color={theme.colors['ink.text-primary']} variant="small" /> | ||
</TouchableOpacity> | ||
<Box> | ||
<Trans> | ||
<Text variant="heading03">CONNECT</Text> | ||
<Text variant="heading03">MPC WALLET</Text> | ||
</Trans> | ||
</Box> | ||
<Box gap="1" pt="5"> | ||
{Object.entries(getUnavailableFeatures()).map(featureEntry => { | ||
const [featureKey, feature] = featureEntry; | ||
const mpcWalletName = feature.title; | ||
function onPress() { | ||
onOpenNotificationsSheet({ | ||
title: t`Connect MPC wallet: ${mpcWalletName}`, | ||
id: featureKey, | ||
}); | ||
} | ||
return ( | ||
<Cell | ||
py="4" | ||
key={featureKey} | ||
onPress={onPress} | ||
title={feature.title} | ||
Icon={feature.Icon} | ||
/> | ||
); | ||
})} | ||
</Box> | ||
</Box> | ||
</ScrollView> | ||
</Box> | ||
<NotifyUserSheet | ||
optionData={optionData} | ||
onCloseNotificationsSheet={onCloseNotificationsSheet} | ||
notifyUserSheetRef={notifyUserSheetRef} | ||
/> | ||
</> | ||
); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.