-
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
24 changed files
with
417 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useLingui } from '@lingui/react'; | ||
|
||
import { Box, Text } from '@leather.io/ui/native'; | ||
|
||
interface AddressTypeBadgeProps { | ||
type: string; | ||
} | ||
export function AddressTypeBadge({ type }: AddressTypeBadgeProps) { | ||
const { i18n } = useLingui(); | ||
|
||
return ( | ||
<Box | ||
bg="ink.background-secondary" | ||
borderColor="ink.border-transparent" | ||
borderRadius="xs" | ||
borderWidth={1} | ||
px="1" | ||
> | ||
<Text color="ink.text-subdued" fontSize={11} fontWeight={500} lineHeight={12}> | ||
{i18n._({ | ||
id: 'address_type_badge.label', | ||
message: '{type}', | ||
values: { type }, | ||
})} | ||
</Text> | ||
</Box> | ||
); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
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,16 @@ | ||
import { AccountId } from '@/models/domain.model'; | ||
import { useAccountDisplayAddress } from '@/store/settings/settings.read'; | ||
|
||
import { Text } from '@leather.io/ui/native'; | ||
import { truncateMiddle } from '@leather.io/utils'; | ||
|
||
type AccountAddressProps = AccountId; | ||
|
||
export function AccountAddress({ accountIndex, fingerprint }: AccountAddressProps) { | ||
const displayAddress = useAccountDisplayAddress(fingerprint, accountIndex); | ||
return ( | ||
<Text variant="caption01" color="ink.text-subdued"> | ||
{truncateMiddle(displayAddress)} | ||
</Text> | ||
); | ||
} |
10 changes: 10 additions & 0 deletions
10
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,10 @@ | ||
import { Balance } from '@/components/balance/balance'; | ||
import { AccountId } from '@/models/domain.model'; | ||
import { useAccountTotalBalance } from '@/queries/balance/total-balance.query'; | ||
|
||
type AccountBalanceProps = AccountId; | ||
|
||
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
47 changes: 47 additions & 0 deletions
47
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,47 @@ | ||
import { AddressTypeBadge } from '@/components/address-type-badge'; | ||
|
||
import { | ||
Box, | ||
CopyIcon, | ||
Flag, | ||
IconButton, | ||
ItemLayout, | ||
Pressable, | ||
Text, | ||
} from '@leather.io/ui/native'; | ||
|
||
interface ReceiveAssetItemProps { | ||
address: string; | ||
addressType?: string; | ||
assetName: string; | ||
assetSymbol: string; | ||
icon: React.ReactNode; | ||
onCopy: () => void; | ||
onPress: () => void; | ||
} | ||
export function ReceiveAssetItem({ | ||
address, | ||
addressType, | ||
assetName, | ||
assetSymbol, | ||
icon, | ||
onCopy, | ||
onPress, | ||
}: ReceiveAssetItemProps) { | ||
return ( | ||
<Pressable flexDirection="row" onPress={onPress}> | ||
<Flag key={assetSymbol} img={icon}> | ||
<ItemLayout | ||
titleLeft={ | ||
<Box alignItems="center" flexDirection="row" gap="1"> | ||
<Text variant="label02">{assetName}</Text> | ||
{addressType && <AddressTypeBadge type={addressType} />} | ||
</Box> | ||
} | ||
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.