-
Notifications
You must be signed in to change notification settings - Fork 6
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
75da079
commit f9b9a33
Showing
59 changed files
with
1,490 additions
and
141 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
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
2 changes: 1 addition & 1 deletion
2
apps/mobile/src/app/(home)/settings/wallet/configure/[wallet]/[account]/index.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
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
9 changes: 1 addition & 8 deletions
9
apps/mobile/src/common/sheet-navigator/sheet-navigation-container.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 |
---|---|---|
@@ -1,18 +1,11 @@ | ||
import { useWindowDimensions } from 'react-native'; | ||
|
||
import { ToastWrapper } from '@/components/toast/toast-context'; | ||
import { HasChildren } from '@/utils/types'; | ||
import { NavigationContainer } from '@react-navigation/native'; | ||
|
||
import { Box } from '@leather.io/ui/native'; | ||
|
||
export function SheetNavigationContainer({ children }: HasChildren) { | ||
const { height } = useWindowDimensions(); | ||
return ( | ||
<ToastWrapper> | ||
<Box flex={1} height={height}> | ||
<NavigationContainer independent>{children}</NavigationContainer> | ||
</Box> | ||
<NavigationContainer independent>{children}</NavigationContainer> | ||
</ToastWrapper> | ||
); | ||
} |
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,56 @@ | ||
import { ResponsiveValue } from '@shopify/restyle'; | ||
|
||
import { Box, Pressable, PressableProps, Text, Theme } from '@leather.io/ui/native'; | ||
import { match } from '@leather.io/utils'; | ||
|
||
export type BadgeVariant = 'success' | 'warning' | 'error' | 'default' | 'info'; | ||
|
||
interface BadgeProps extends PressableProps { | ||
title: string; | ||
variant: BadgeVariant; | ||
} | ||
|
||
export function Badge(props: BadgeProps) { | ||
const matchBadgeVariant = match<BadgeVariant>(); | ||
|
||
const backgroundColor = matchBadgeVariant< | ||
ResponsiveValue<keyof Theme['colors'], Theme['breakpoints']> | ||
>(props.variant, { | ||
success: 'green.background-primary', | ||
warning: 'yellow.background-primary', | ||
error: 'red.background-primary', | ||
default: 'ink.background-secondary', | ||
info: 'blue.background-primary', | ||
}); | ||
|
||
const borderColor = matchBadgeVariant< | ||
ResponsiveValue<keyof Theme['colors'], Theme['breakpoints']> | ||
>(props.variant, { | ||
success: 'green.border', | ||
warning: 'yellow.border', | ||
error: 'red.border', | ||
default: 'ink.border-transparent', | ||
info: 'blue.border', | ||
}); | ||
|
||
const textColor = matchBadgeVariant<ResponsiveValue<keyof Theme['colors'], Theme['breakpoints']>>( | ||
props.variant, | ||
{ | ||
success: 'green.action-primary-default', | ||
warning: 'yellow.action-primary-default', | ||
error: 'red.action-primary-default', | ||
default: 'ink.text-subdued', | ||
info: 'blue.action-primary-default', | ||
} | ||
); | ||
|
||
return ( | ||
<Pressable {...props}> | ||
<Box bg={backgroundColor} borderColor={borderColor} borderRadius="xs" borderWidth={1} p="1"> | ||
<Text variant="label03" color={textColor}> | ||
{props.title} | ||
</Text> | ||
</Box> | ||
</Pressable> | ||
); | ||
} |
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,44 @@ | ||
import { useLingui } from '@lingui/react'; | ||
|
||
import { match } from '@leather.io/utils'; | ||
|
||
import { Badge, BadgeVariant } from './badge'; | ||
|
||
type FeeType = 'low' | 'normal' | 'high' | 'extremely-high'; | ||
|
||
interface FeeBadgeProps { | ||
type: FeeType; | ||
} | ||
|
||
export function FeeBadge(props: FeeBadgeProps) { | ||
const { i18n } = useLingui(); | ||
const matchVariant = match<FeeType>(); | ||
|
||
const variant = matchVariant<BadgeVariant>(props.type, { | ||
low: 'success', | ||
normal: 'default', | ||
high: 'error', | ||
'extremely-high': 'error', | ||
}); | ||
|
||
const title = matchVariant<string>(props.type, { | ||
low: i18n._({ | ||
id: 'approval-ux.fees.low', | ||
message: 'currently low', | ||
}), | ||
normal: i18n._({ | ||
id: 'approval-ux.fees.normal', | ||
message: 'currently normal', | ||
}), | ||
high: i18n._({ | ||
id: 'approval-ux.fees.high', | ||
message: 'currently high', | ||
}), | ||
'extremely-high': i18n._({ | ||
id: 'approval-ux.fees.extremely-high', | ||
message: 'currently extremely high', | ||
}), | ||
}); | ||
|
||
return <Badge variant={variant} px="1" title={title} />; | ||
} |
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,25 @@ | ||
import { AppRoutes } from '@/routes'; | ||
import { useSettings } from '@/store/settings/settings'; | ||
import { useLingui } from '@lingui/react'; | ||
import { useRouter } from 'expo-router'; | ||
|
||
import { Badge } from './badge'; | ||
|
||
export function NetworkBadge() { | ||
const router = useRouter(); | ||
const { i18n } = useLingui(); | ||
const { networkPreference } = useSettings(); | ||
|
||
return ( | ||
<Badge | ||
variant="default" | ||
px="3" | ||
onPress={() => router.navigate(AppRoutes.SettingsNetworks)} | ||
title={i18n._({ | ||
id: 'settings.header_network', | ||
message: '{network}', | ||
values: { network: networkPreference.name }, | ||
})} | ||
/> | ||
); | ||
} |
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 was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
apps/mobile/src/features/approver/components/advanced-details-button.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,28 @@ | ||
import { t } from '@lingui/macro'; | ||
|
||
import { ChevronDownIcon, ChevronUpIcon, Pressable, Text } from '@leather.io/ui/native'; | ||
|
||
export function AdvancedDetailsButton({ | ||
isAdvancedOpen, | ||
setIsAdvancedOpen, | ||
}: { | ||
isAdvancedOpen: boolean; | ||
setIsAdvancedOpen(value: boolean): void; | ||
}) { | ||
const buttonTitle = isAdvancedOpen ? t`Hide advanced details` : t`Show advanced details`; | ||
const chevron = isAdvancedOpen ? <ChevronUpIcon /> : <ChevronDownIcon />; | ||
return ( | ||
<Pressable | ||
flexDirection="row" | ||
py="3" | ||
my="3" | ||
px="5" | ||
justifyContent="space-between" | ||
bg="ink.background-secondary" | ||
onPress={() => setIsAdvancedOpen(!isAdvancedOpen)} | ||
> | ||
<Text variant="label01">{buttonTitle}</Text> | ||
{chevron} | ||
</Pressable> | ||
); | ||
} |
27 changes: 27 additions & 0 deletions
27
apps/mobile/src/features/approver/components/approver-account-card.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,27 @@ | ||
import { AvatarIcon } from '@/components/avatar-icon'; | ||
import { AccountListItem } from '@/features/account-list/account-list-item'; | ||
import { useWallets } from '@/store/wallets/wallets.read'; | ||
import { t } from '@lingui/macro'; | ||
import { useTheme } from '@shopify/restyle'; | ||
|
||
import { Text, Theme } from '@leather.io/ui/native'; | ||
|
||
export function ApproverAccountCard() { | ||
const theme = useTheme<Theme>(); | ||
const { list: walletsList } = useWallets(); | ||
const wallet = walletsList[0]; | ||
/* eslint-disable-next-line lingui/no-unlocalized-strings */ | ||
const testAccountName = 'testName'; | ||
return ( | ||
<> | ||
<Text variant="label01">{t`With account`}</Text> | ||
<AccountListItem | ||
accountName={testAccountName} | ||
address={t`Address`} | ||
balance={t`$1234`} | ||
icon={<AvatarIcon color={theme.colors['ink.background-primary']} icon="code" />} | ||
walletName={wallet?.name} | ||
/> | ||
</> | ||
); | ||
} |
Oops, something went wrong.