Compare commits

...

2 Commits

Author SHA1 Message Date
Bill He
1823690299
Update based on latest designs 2023-10-31 10:47:30 -07:00
Bill He
846c6ca608
Account dropdown onboarding entrypoints 2023-10-30 22:21:44 -07:00
5 changed files with 68 additions and 24 deletions

View File

@ -24,9 +24,10 @@ import {
CommentIcon, CommentIcon,
CopyIcon, CopyIcon,
CubeIcon, CubeIcon,
DepositIcon,
DepthChartIcon,
DiscordIcon, DiscordIcon,
EtherscanIcon, EtherscanIcon,
DepthChartIcon,
ExportKeysIcon, ExportKeysIcon,
FeedbackIcon, FeedbackIcon,
FileIcon, FileIcon,
@ -69,6 +70,7 @@ import {
WarningIcon, WarningIcon,
WebsiteIcon, WebsiteIcon,
WhitepaperIcon, WhitepaperIcon,
WithdrawIcon,
} from '@/icons'; } from '@/icons';
export enum IconName { export enum IconName {
@ -93,6 +95,7 @@ export enum IconName {
Comment = 'Comment', Comment = 'Comment',
Copy = 'Copy', Copy = 'Copy',
Cube = 'Cube', Cube = 'Cube',
Deposit = 'Deposit',
DepthChart = 'DepthChart', DepthChart = 'DepthChart',
Discord = 'Discord', Discord = 'Discord',
Etherscan = 'Etherscan', Etherscan = 'Etherscan',
@ -139,6 +142,7 @@ export enum IconName {
Warning = 'Warning', Warning = 'Warning',
Website = 'Website', Website = 'Website',
Whitepaper = 'Whitepaper', Whitepaper = 'Whitepaper',
Withdraw = 'Withdraw',
} }
const icons = { const icons = {
@ -163,6 +167,7 @@ const icons = {
[IconName.Comment]: CommentIcon, [IconName.Comment]: CommentIcon,
[IconName.Copy]: CopyIcon, [IconName.Copy]: CopyIcon,
[IconName.Cube]: CubeIcon, [IconName.Cube]: CubeIcon,
[IconName.Deposit]: DepositIcon,
[IconName.DepthChart]: DepthChartIcon, [IconName.DepthChart]: DepthChartIcon,
[IconName.Discord]: DiscordIcon, [IconName.Discord]: DiscordIcon,
[IconName.Etherscan]: EtherscanIcon, [IconName.Etherscan]: EtherscanIcon,
@ -208,6 +213,7 @@ const icons = {
[IconName.Warning]: WarningIcon, [IconName.Warning]: WarningIcon,
[IconName.Website]: WebsiteIcon, [IconName.Website]: WebsiteIcon,
[IconName.Whitepaper]: WhitepaperIcon, [IconName.Whitepaper]: WhitepaperIcon,
[IconName.Withdraw]: WithdrawIcon,
} as Record<IconName, ElementType>; } as Record<IconName, ElementType>;
type ElementProps = { type ElementProps = {

11
src/icons/deposit.svg Normal file
View File

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
<g clip-path="url(#clip0_18204_36775)">
<path d="M13.2426 6.25736C14.0817 7.09647 14.6531 8.16557 14.8846 9.32946C15.1162 10.4933 14.9973 11.6997 14.5432 12.7961C14.0891 13.8925 13.32 14.8295 12.3334 15.4888C11.3467 16.1481 10.1866 16.5 8.99993 16.5C7.81324 16.5 6.6532 16.1481 5.66651 15.4888C4.67981 14.8295 3.91078 13.8925 3.45665 12.7961C3.00253 11.6997 2.88371 10.4933 3.11522 9.32946C3.34673 8.16557 3.91817 7.09647 4.75729 6.25736" stroke="#C8C7D8" stroke-width="1.35" stroke-linecap="round"/>
<path d="M11.25 9L9 11.25M9 11.25L6.75 9M9 11.25V1.6875" stroke="#C8C7D8" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_18204_36775">
<rect width="18" height="18" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 886 B

View File

@ -19,6 +19,7 @@ export { default as CoinsIcon } from './coins.svg';
export { default as CommentIcon } from './comment.svg'; export { default as CommentIcon } from './comment.svg';
export { default as CopyIcon } from './copy.svg'; export { default as CopyIcon } from './copy.svg';
export { default as CubeIcon } from './cube.svg'; export { default as CubeIcon } from './cube.svg';
export { default as DepositIcon } from './deposit.svg';
export { default as DepthChartIcon } from './depth-chart.svg'; export { default as DepthChartIcon } from './depth-chart.svg';
export { default as DiscordIcon } from './discord.svg'; export { default as DiscordIcon } from './discord.svg';
export { default as ExportKeysIcon } from './export-keys.svg'; export { default as ExportKeysIcon } from './export-keys.svg';
@ -59,6 +60,7 @@ export { default as TransferIcon } from './transfer.svg';
export { default as TriangleIcon } from './triangle.svg'; export { default as TriangleIcon } from './triangle.svg';
export { default as TryAgainIcon } from './try-again.svg'; export { default as TryAgainIcon } from './try-again.svg';
export { default as WarningIcon } from './warning.svg'; export { default as WarningIcon } from './warning.svg';
export { default as WithdrawIcon } from './withdraw.svg';
// Wallets // Wallets
export { default as BitkeepIcon } from './wallets/bitkeep.svg'; export { default as BitkeepIcon } from './wallets/bitkeep.svg';

4
src/icons/withdraw.svg Normal file
View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path d="M13.2426 6.2573C14.0817 7.09641 14.6531 8.16551 14.8846 9.3294C15.1162 10.4933 14.9973 11.6997 14.5432 12.796C14.0891 13.8924 13.32 14.8295 12.3334 15.4888C11.3467 16.148 10.1866 16.4999 8.99993 16.4999C7.81324 16.4999 6.6532 16.148 5.66651 15.4888C4.67981 14.8295 3.91078 13.8924 3.45665 12.796C3.00253 11.6997 2.88371 10.4933 3.11522 9.3294C3.34673 8.16551 3.91817 7.09641 4.75729 6.2573" stroke="#C8C7D8" stroke-width="1.35" stroke-linecap="round"/>
<path d="M11.25 2.9375L9 0.6875M9 0.6875L6.75 2.9375M9 0.6875V10.25" stroke="#C8C7D8" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 723 B

View File

@ -139,7 +139,7 @@ export const AccountMenu = () => {
fractionDigits={2} fractionDigits={2}
/> />
</div> </div>
<AssetActions asset={DydxChainAsset.USDC} dispatch={dispatch} /> <AssetActions asset={DydxChainAsset.USDC} dispatch={dispatch} withOnboarding />
</div> </div>
</Styled.Balances> </Styled.Balances>
</Styled.AccountInfo> </Styled.AccountInfo>
@ -212,28 +212,45 @@ export const AccountMenu = () => {
); );
}; };
const AssetActions = memo(({ asset, dispatch }: { asset: DydxChainAsset; dispatch: Dispatch }) => ( const AssetActions = memo(
<Styled.InlineRow> ({
{[ asset,
// TODO(@rosepuppy): Add withdraw action for USDC dispatch,
{ withOnboarding,
dialogType: DialogTypes.Receive, }: {
iconName: IconName.Qr, asset: DydxChainAsset;
}, dispatch: Dispatch;
{ dialogType: DialogTypes.Transfer, iconName: IconName.Send }, withOnboarding?: boolean;
].map(({ iconName, dialogType }) => ( }) => (
<IconButton <Styled.InlineRow>
key={dialogType} {[
action={ButtonAction.Base} withOnboarding && {
shape={ButtonShape.Square} dialogType: DialogTypes.Withdraw,
iconName={iconName} iconName: IconName.Withdraw,
onClick={() => },
dispatch(openDialog({ type: dialogType, dialogProps: { selectedAsset: asset } })) withOnboarding && {
} dialogType: DialogTypes.Deposit,
/> iconName: IconName.Deposit,
))} },
</Styled.InlineRow> {
)); dialogType: DialogTypes.Transfer,
dialogProps: { selectedAsset: asset },
iconName: IconName.Send,
},
]
.filter(isTruthy)
.map(({ iconName, dialogType, dialogProps }) => (
<Styled.IconButton
key={dialogType}
action={ButtonAction.Base}
shape={ButtonShape.Square}
iconName={iconName}
onClick={() => dispatch(openDialog({ type: dialogType, dialogProps }))}
/>
))}
</Styled.InlineRow>
)
);
const Styled: Record<string, AnyStyledComponent> = {}; const Styled: Record<string, AnyStyledComponent> = {};
@ -351,3 +368,7 @@ Styled.ConnectToChain = styled(Styled.Column)`
font: var(--font-small-book); font: var(--font-small-book);
} }
`; `;
Styled.IconButton = styled(IconButton)`
--button-padding: 0 0.25rem;
`;