forked from LedgerHQ/ledger-live
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display solana frozen token accounts
- Loading branch information
Showing
11 changed files
with
256 additions
and
18 deletions.
There are no files selected for viewing
29 changes: 27 additions & 2 deletions
29
apps/ledger-live-desktop/src/renderer/families/solana/AccountSubHeader.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,5 +1,30 @@ | ||
import React from "react"; | ||
import { Trans } from "react-i18next"; | ||
import { SolanaAccount, SolanaTokenAccount } from "@ledgerhq/live-common/families/solana/types"; | ||
import { isTokenAccountFrozen } from "@ledgerhq/live-common/families/solana/logic"; | ||
import { SubAccount } from "@ledgerhq/types-live"; | ||
|
||
import Box from "~/renderer/components/Box"; | ||
import Alert from "~/renderer/components/Alert"; | ||
import AccountSubHeader from "../../components/AccountSubHeader/index"; | ||
export default function SolanaAccountSubHeader() { | ||
return <AccountSubHeader family="Solana" team="Solana Labs"></AccountSubHeader>; | ||
|
||
type Account = SolanaAccount | SolanaTokenAccount | SubAccount; | ||
|
||
type Props = { | ||
account: Account; | ||
}; | ||
|
||
export default function SolanaAccountSubHeader({ account }: Props) { | ||
return ( | ||
<> | ||
{isTokenAccountFrozen(account) && ( | ||
<Box mb={10}> | ||
<Alert type="warning"> | ||
<Trans i18nKey="solana.token.frozenStateWarning" /> | ||
</Alert> | ||
</Box> | ||
)} | ||
<AccountSubHeader family="Solana" team="Solana Labs eeee"></AccountSubHeader> | ||
</> | ||
); | ||
} |
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
28 changes: 26 additions & 2 deletions
28
apps/ledger-live-mobile/src/families/solana/AccountSubHeader.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,8 +1,32 @@ | ||
import React from "react"; | ||
import { Trans } from "react-i18next"; | ||
import { SubAccount } from "@ledgerhq/types-live"; | ||
import { Box, Alert, Text } from "@ledgerhq/native-ui"; | ||
import { isTokenAccountFrozen } from "@ledgerhq/live-common/families/solana/logic"; | ||
import { SolanaAccount, SolanaTokenAccount } from "@ledgerhq/live-common/families/solana/types"; | ||
import AccountSubHeader from "~/components/AccountSubHeader"; | ||
|
||
function SolanaAccountSubHeader() { | ||
return <AccountSubHeader family="Solana" team="Solana Labs" />; | ||
type Account = SolanaAccount | SolanaTokenAccount | SubAccount; | ||
|
||
type Props = { | ||
account: Account; | ||
}; | ||
|
||
function SolanaAccountSubHeader({ account }: Props) { | ||
return ( | ||
<> | ||
{isTokenAccountFrozen(account) && ( | ||
<Box mt={6}> | ||
<Alert type="warning"> | ||
<Text variant="body"> | ||
<Trans i18nKey="solana.token.frozenStateWarning" /> | ||
</Text> | ||
</Alert> | ||
</Box> | ||
)} | ||
<AccountSubHeader family="Solana" team="Solana Labs" /> | ||
</> | ||
); | ||
} | ||
|
||
export default SolanaAccountSubHeader; |
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
Oops, something went wrong.