-
-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile): staking view-only (#14561)
- Loading branch information
Showing
46 changed files
with
1,195 additions
and
46 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
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
48 changes: 48 additions & 0 deletions
48
suite-native/accounts/src/components/AccountsList/AccountsListStakingItem.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,48 @@ | ||
import { Account } from '@suite-common/wallet-types'; | ||
import { RoundedIcon } from '@suite-native/atoms'; | ||
import { CryptoAmountFormatter, CryptoToFiatAmountFormatter } from '@suite-native/formatters'; | ||
import { Translation } from '@suite-native/intl'; | ||
|
||
import { AccountsListItemBase } from './AccountsListItemBase'; | ||
|
||
type AccountsListStakingItemProps = { | ||
account: Account; | ||
stakingCryptoBalance: string; | ||
onPress: () => void; | ||
|
||
hasBackground?: boolean; | ||
isFirst?: boolean; | ||
isLast?: boolean; | ||
}; | ||
|
||
export const AccountsListStakingItem = ({ | ||
account, | ||
stakingCryptoBalance, | ||
isLast, | ||
...props | ||
}: AccountsListStakingItemProps) => { | ||
return ( | ||
<AccountsListItemBase | ||
{...props} | ||
isLast={isLast} | ||
showDivider={!isLast} | ||
icon={<RoundedIcon name="piggyBankFilled" color="iconSubdued" />} | ||
title={<Translation id="accountList.staking" />} | ||
mainValue={ | ||
<CryptoToFiatAmountFormatter | ||
value={stakingCryptoBalance} | ||
network={account.symbol} | ||
isBalance | ||
/> | ||
} | ||
secondaryValue={ | ||
<CryptoAmountFormatter | ||
value={stakingCryptoBalance} | ||
network={account.symbol} | ||
numberOfLines={1} | ||
adjustsFontSizeToFit | ||
/> | ||
} | ||
/> | ||
); | ||
}; |
13 changes: 13 additions & 0 deletions
13
suite-native/accounts/src/components/AccountsList/StakingBadge.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,13 @@ | ||
import { RoundedIcon, RoundedIconProps } from '@suite-native/atoms'; | ||
|
||
export const StakingBadge = (props: Partial<RoundedIconProps>) => { | ||
return ( | ||
<RoundedIcon | ||
name="piggyBank" | ||
color="textSubdued" | ||
iconSize="small" | ||
containerSize={22} | ||
{...props} | ||
/> | ||
); | ||
}; |
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
Oops, something went wrong.