-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
address requested changes and improve interface responsivnes
- Loading branch information
1 parent
16d0937
commit 2e6c5c6
Showing
13 changed files
with
252 additions
and
220 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
54 changes: 54 additions & 0 deletions
54
packages/examples/packages/send-flow/src/components/AccountSelector.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,54 @@ | ||
import { | ||
Card, | ||
Field, | ||
Selector, | ||
SelectorOption, | ||
type SnapComponent, | ||
} from '@metamask/snaps-sdk/jsx'; | ||
|
||
import type { Account } from '../types'; | ||
import { truncate } from '../utils'; | ||
|
||
/** | ||
* The props for the {@link AccountSelector} component. | ||
* | ||
* @property selectedAccount - The currently selected account. | ||
* @property accounts - The available accounts. | ||
*/ | ||
export type AccountSelectorProps = { | ||
selectedAccount: string; | ||
accounts: Account[]; | ||
}; | ||
|
||
/** | ||
* A component that shows the account selector. | ||
* | ||
* @param props - The component props. | ||
* @param props.selectedAccount - The currently selected account. | ||
* @param props.accounts - The available accounts. | ||
* @returns The AccountSelector component. | ||
*/ | ||
export const AccountSelector: SnapComponent<AccountSelectorProps> = ({ | ||
selectedAccount, | ||
accounts, | ||
}) => ( | ||
<Field label={'From account'}> | ||
<Selector | ||
name="accountSelector" | ||
title="From account" | ||
value={selectedAccount} | ||
> | ||
{accounts.map(({ name, address, balance, icon }) => ( | ||
<SelectorOption value={address}> | ||
<Card | ||
image={icon} | ||
title={name} | ||
description={truncate(address, 13)} | ||
value={`${balance.amount.toString()} BTC`} | ||
extra={`$${balance.fiat.toString()}`} | ||
/> | ||
</SelectorOption> | ||
))} | ||
</Selector> | ||
</Field> | ||
); |
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
12 changes: 12 additions & 0 deletions
12
packages/examples/packages/send-flow/src/components/SendFlowFooter.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,12 @@ | ||
import { Button, Footer, type SnapComponent } from '@metamask/snaps-sdk/jsx'; | ||
|
||
/** | ||
* A component that shows the send flow footer. | ||
* | ||
* @returns The SendFlowFooter component. | ||
*/ | ||
export const SendFlowFooter: SnapComponent = () => ( | ||
<Footer> | ||
<Button name="review">Review</Button> | ||
</Footer> | ||
); |
Oops, something went wrong.