-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
23 changed files
with
372 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
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
17 changes: 17 additions & 0 deletions
17
apps/mobile/src/features/account-list/components/account-address.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,17 @@ | ||
import { useAccountDisplayAddress } from '@/store/settings/settings.read'; | ||
|
||
import { Text } from '@leather.io/ui/native'; | ||
import { truncateMiddle } from '@leather.io/utils'; | ||
|
||
interface AccountAddressProps { | ||
accountIndex: number; | ||
fingerprint: string; | ||
} | ||
export function AccountAddress({ accountIndex, fingerprint }: AccountAddressProps) { | ||
const displayAddress = useAccountDisplayAddress(fingerprint, accountIndex); | ||
return ( | ||
<Text variant="caption01" color="ink.text-subdued"> | ||
{truncateMiddle(displayAddress)} | ||
</Text> | ||
); | ||
} |
11 changes: 11 additions & 0 deletions
11
apps/mobile/src/features/account-list/components/account-balance.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,11 @@ | ||
import { Balance } from '@/components/balance/balance'; | ||
import { useAccountTotalBalance } from '@/queries/balance/total-balance.query'; | ||
|
||
interface AccountBalanceProps { | ||
accountIndex: number; | ||
fingerprint: string; | ||
} | ||
export function AccountBalance({ accountIndex, fingerprint }: AccountBalanceProps) { | ||
const { totalBalance } = useAccountTotalBalance({ fingerprint, accountIndex }); | ||
return <Balance balance={totalBalance} variant="label02" />; | ||
} |
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
30 changes: 30 additions & 0 deletions
30
apps/mobile/src/features/receive/receive-sheets/receive-asset-item.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,30 @@ | ||
import { CopyIcon, Flag, IconButton, ItemLayout, Pressable } from '@leather.io/ui/native'; | ||
|
||
interface ReceiveAssetItemProps { | ||
address: string; | ||
assetName: string; | ||
assetSymbol: string; | ||
icon: React.ReactNode; | ||
onCopy: () => void; | ||
onPress: () => void; | ||
} | ||
export function ReceiveAssetItem({ | ||
address, | ||
assetName, | ||
assetSymbol, | ||
icon, | ||
onCopy, | ||
onPress, | ||
}: ReceiveAssetItemProps) { | ||
return ( | ||
<Pressable flexDirection="row" onPress={onPress}> | ||
<Flag key={assetSymbol} img={icon}> | ||
<ItemLayout | ||
titleLeft={assetName} | ||
actionIcon={<IconButton icon={<CopyIcon />} onPress={onCopy} />} | ||
captionLeft={address} | ||
/> | ||
</Flag> | ||
</Pressable> | ||
); | ||
} |
31 changes: 31 additions & 0 deletions
31
apps/mobile/src/features/receive/receive-sheets/receive-asset-sheet.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,31 @@ | ||
import { RefObject } from 'react'; | ||
import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
|
||
import { useSettings } from '@/store/settings/settings'; | ||
import { t } from '@lingui/macro'; | ||
import { useTheme } from '@shopify/restyle'; | ||
|
||
import { Box, Sheet, SheetRef, Text, Theme } from '@leather.io/ui/native'; | ||
|
||
interface ReceiveAssetSheetProps { | ||
sheetRef: RefObject<SheetRef>; | ||
} | ||
export function ReceiveAssetSheet({ sheetRef }: ReceiveAssetSheetProps) { | ||
const { bottom } = useSafeAreaInsets(); | ||
const { themeDerivedFromThemePreference } = useSettings(); | ||
const theme = useTheme<Theme>(); | ||
|
||
return ( | ||
<Sheet isScrollView ref={sheetRef} themeVariant={themeDerivedFromThemePreference}> | ||
<Box | ||
style={{ | ||
paddingBottom: theme.spacing[5] + bottom, | ||
paddingHorizontal: theme.spacing[5], | ||
paddingTop: theme.spacing[4], | ||
}} | ||
> | ||
<Text>{t`Receive`}</Text> | ||
</Box> | ||
</Sheet> | ||
); | ||
} |
Oops, something went wrong.