-
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
d2021f9
commit a0909d7
Showing
25 changed files
with
873 additions
and
273 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 |
---|---|---|
|
@@ -248,7 +248,7 @@ PODS: | |
- ExpoModulesCore | ||
- ExpoLocalAuthentication (14.0.1): | ||
- ExpoModulesCore | ||
- ExpoModulesCore (1.12.26): | ||
- ExpoModulesCore (1.12.20): | ||
- DoubleConversion | ||
- glog | ||
- hermes-engine | ||
|
@@ -1643,7 +1643,7 @@ DEPENDENCIES: | |
- "ExpoImage (from `../../../node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected]_@[email protected]_pqycbzooiimpwcftmzylw6b6ue/node_modules/expo-image/ios`)" | ||
- "ExpoKeepAwake (from `../../../node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected]_@babel+core@7_w5fcokd4xqykouihhq65zfvhwu/node_modules/expo-keep-awake/ios`)" | ||
- "ExpoLocalAuthentication (from `../../../node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected]_@ba_bcvjridgatxs26fiu2o33lgbby/node_modules/expo-local-authentication/ios`)" | ||
- "ExpoModulesCore (from `../../../node_modules/.pnpm/[email protected].26/node_modules/expo-modules-core`)" | ||
- "ExpoModulesCore (from `../../../node_modules/.pnpm/[email protected].20/node_modules/expo-modules-core`)" | ||
- "ExpoSecureStore (from `../../../node_modules/.pnpm/[email protected][email protected]_@[email protected]._qblhklgyytdrqryzqbjo45ylay/node_modules/expo-secure-store/ios`)" | ||
- "ExpoSystemUI (from `../../../node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected]_@[email protected]_36opljfl2csscygkp6xjaz2hv4/node_modules/expo-system-ui/ios`)" | ||
- "ExpoWebBrowser (from `../../../node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected]_@babel+core@_rn7tpmwskp4kjoe2dtluysnlry/node_modules/expo-web-browser/ios`)" | ||
|
@@ -1778,7 +1778,7 @@ EXTERNAL SOURCES: | |
ExpoLocalAuthentication: | ||
:path: "../../../node_modules/.pnpm/[email protected][email protected]_@[email protected]_@[email protected]_@ba_bcvjridgatxs26fiu2o33lgbby/node_modules/expo-local-authentication/ios" | ||
ExpoModulesCore: | ||
:path: "../../../node_modules/.pnpm/[email protected].26/node_modules/expo-modules-core" | ||
:path: "../../../node_modules/.pnpm/[email protected].20/node_modules/expo-modules-core" | ||
ExpoSecureStore: | ||
:path: "../../../node_modules/.pnpm/[email protected][email protected]_@[email protected]._qblhklgyytdrqryzqbjo45ylay/node_modules/expo-secure-store/ios" | ||
ExpoSystemUI: | ||
|
@@ -1944,7 +1944,7 @@ SPEC CHECKSUMS: | |
ExpoImage: eab004b9363e388d3f6a118f18716de6dcfb8e8d | ||
ExpoKeepAwake: 3b8815d9dd1d419ee474df004021c69fdd316d08 | ||
ExpoLocalAuthentication: 9e02a56a4cf9868f0052656a93d4c94101a42ed7 | ||
ExpoModulesCore: 831ece8311a489418746925820bbffdda587d6f4 | ||
ExpoModulesCore: 5440e96a8ee014f4fd88e77264985fd0a65f5f8c | ||
ExpoSecureStore: 060cebcb956b80ddae09821610ac1aa9e1ac74cd | ||
ExpoSystemUI: d4f065a016cae6721b324eb659cdee4d4cf0cb26 | ||
ExpoWebBrowser: 7595ccac6938eb65b076385fd23d035db9ecdc8e | ||
|
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
56 changes: 0 additions & 56 deletions
56
apps/mobile/src/features/approver/components/fee-options.tsx
This file was deleted.
Oops, something went wrong.
20 changes: 10 additions & 10 deletions
20
.../approver/components/bitcoin-fee-card.tsx → ...pprover/components/fees/base-fee-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
60 changes: 60 additions & 0 deletions
60
apps/mobile/src/features/approver/components/fees/base-fee-option.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,60 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
import { Avatar, Box, ItemLayout, Pressable } from '@leather.io/ui/native'; | ||
|
||
interface BaseFeeOptionProps { | ||
onPress(): void; | ||
isSelected: boolean; | ||
disabled: boolean; | ||
icon: ReactNode; | ||
title: string; | ||
time: string; | ||
balance: string; | ||
balanceUsd: string; | ||
} | ||
|
||
export function BaseFeeOption({ | ||
onPress, | ||
isSelected, | ||
disabled, | ||
icon, | ||
title, | ||
time, | ||
balance, | ||
balanceUsd, | ||
}: BaseFeeOptionProps) { | ||
return ( | ||
<> | ||
<Pressable | ||
borderColor={isSelected ? 'ink.text-primary' : 'ink.border-default'} | ||
borderWidth={1} | ||
borderRadius="xs" | ||
flexDirection="row" | ||
alignItems="center" | ||
p="3" | ||
gap="3" | ||
onPress={onPress} | ||
disabled={disabled} | ||
> | ||
<Avatar>{icon}</Avatar> | ||
<ItemLayout | ||
titleLeft={title} | ||
captionLeft={time} | ||
titleRight={balance} | ||
captionRight={balanceUsd} | ||
/> | ||
{disabled && ( | ||
<Box | ||
top={0} | ||
bottom={0} | ||
right={0} | ||
left={0} | ||
position="absolute" | ||
backgroundColor="ink.background-overlay" | ||
opacity={0.1} | ||
/> | ||
)} | ||
</Pressable> | ||
</> | ||
); | ||
} |
28 changes: 28 additions & 0 deletions
28
apps/mobile/src/features/approver/components/fees/bitcoin-fee-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,28 @@ | ||
import { useBtcMarketDataQuery } from '@/queries/market-data/btc-market-data.query'; | ||
|
||
import { FeeTypes, Money } from '@leather.io/models'; | ||
|
||
import { getBitcoinFeeData } from '../../utils'; | ||
import { BaseFeeCard } from './base-fee-card'; | ||
|
||
interface FeeCardProps { | ||
feeType: FeeTypes; | ||
amount: Money; | ||
onPress(): void; | ||
} | ||
|
||
export function BitcoinFeeCard({ feeType, amount, onPress }: FeeCardProps) { | ||
const { data: btcMarketData } = useBtcMarketDataQuery(); | ||
const { icon, title, time } = getBitcoinFeeData(feeType); | ||
|
||
return ( | ||
<BaseFeeCard | ||
amount={amount} | ||
onPress={onPress} | ||
marketData={btcMarketData} | ||
icon={icon} | ||
title={title} | ||
time={time} | ||
/> | ||
); | ||
} |
47 changes: 47 additions & 0 deletions
47
apps/mobile/src/features/approver/components/fees/bitcoin-fee-option.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 { formatBalance } from '@/components/balance/balance'; | ||
import { useLingui } from '@lingui/react'; | ||
|
||
import { FeeTypes, Money } from '@leather.io/models'; | ||
import { createMoney } from '@leather.io/utils'; | ||
|
||
import { getBitcoinFeeData } from '../../utils'; | ||
import { BaseFeeOption } from './base-fee-option'; | ||
|
||
interface BitcoinFeeOptionProps { | ||
feeType: FeeTypes; | ||
fee: number; | ||
feeRate: number; | ||
usd: Money; | ||
onPress(): void; | ||
isSelected: boolean; | ||
disabled: boolean; | ||
} | ||
|
||
export function BitcoinFeeOption({ | ||
feeType, | ||
fee, | ||
feeRate, | ||
usd, | ||
onPress, | ||
isSelected, | ||
disabled, | ||
}: BitcoinFeeOptionProps) { | ||
const { i18n } = useLingui(); | ||
const sats = createMoney(fee, 'BTC'); | ||
return ( | ||
<BaseFeeOption | ||
onPress={onPress} | ||
icon={getBitcoinFeeData(feeType).icon} | ||
title={getBitcoinFeeData(feeType).title} | ||
time={getBitcoinFeeData(feeType).time} | ||
isSelected={isSelected} | ||
disabled={disabled} | ||
balance={formatBalance(sats, false)} | ||
balanceUsd={i18n._({ | ||
id: 'fees-sheet.fee-rate-caption', | ||
message: '{feeRate} sats/B · {balanceUsd}', | ||
values: { feeRate, balanceUsd: formatBalance(usd, true) }, | ||
})} | ||
/> | ||
); | ||
} |
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.