Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

styleable wallet icon #851

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/minifront/src/components/shared/input-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Validation } from './validation-result';
import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value';
import { InputBlock } from './input-block';
import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb';
import { WalletIcon } from '@penumbra-zone/ui/components/ui/icons/wallet';

interface InputTokenProps extends InputProps {
label: string;
Expand Down Expand Up @@ -49,7 +50,7 @@ export default function InputToken({

<div className='mt-[6px] flex items-center justify-between gap-2'>
<div className='flex items-start gap-1 truncate'>
<img src='./wallet.svg' alt='Wallet' className='size-5' />
<WalletIcon className='size-5' />
<ValueViewComponent view={selection?.balanceView} showIcon={false} />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Validator } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core
import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb';
import { FormEvent } from 'react';
import { getIdentityKey } from '@penumbra-zone/getters/src/validator';
import { WalletIcon } from '@penumbra-zone/ui/components/ui/icons/wallet';

const getCapitalizedAction = (action: 'delegate' | 'undelegate') =>
action.replace(/^./, firstCharacter => firstCharacter.toLocaleUpperCase());
Expand Down Expand Up @@ -90,7 +91,7 @@ export const FormDialog = ({
/>

<div className='flex items-start gap-1 truncate text-muted-foreground'>
<img src='./wallet.svg' alt='Wallet' className='size-5' />
<WalletIcon className='size-5' />
<ValueViewComponent
view={action === 'delegate' ? unstakedTokens : delegationTokens}
showIcon={false}
Expand Down
3 changes: 2 additions & 1 deletion apps/minifront/src/components/swap/asset-out-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Amount } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/nu

import { formatNumber, isZero } from '@penumbra-zone/types/src/amount';
import { getAmount } from '@penumbra-zone/getters/src/value-view';
import { WalletIcon } from '@penumbra-zone/ui/components/ui/icons/wallet';

const findMatchingBalance = (
metadata: Metadata | undefined,
Expand Down Expand Up @@ -71,7 +72,7 @@ export const AssetOutBox = ({ balances }: AssetOutBoxProps) => {
<div className='mt-[6px] flex items-start justify-between'>
<div />
<div className='flex items-start gap-1'>
<img src='./wallet.svg' alt='Wallet' className='size-5' />
<WalletIcon className='size-5' />
<ValueViewComponent view={matchingBalance} showIcon={false} />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.9167 12.9167C13.6083 12.9167 14.1667 12.3583 14.1667 11.6667C14.1667 10.975 13.6083 10.4167 12.9167 10.4167C12.225 10.4167 11.6667 10.975 11.6667 11.6667C11.6667 12.3583 12.225 12.9167 12.9167 12.9167ZM5.83333 2.5H14.1667C15.0917 2.5 15.8333 3.25 15.8333 4.16667V5.83333C16.7583 5.83333 17.5 6.58333 17.5 7.5V15.8333C17.5 16.7583 16.7583 17.5 15.8333 17.5H5.83333C3.99167 17.5 2.5 16.0083 2.5 14.1667V5.83333C2.5 3.99167 3.99167 2.5 5.83333 2.5ZM14.1667 5.83333V4.16667H5.83333C4.91667 4.16667 4.16667 4.91667 4.16667 5.83333V6.28333C4.65833 6 5.225 5.83333 5.83333 5.83333H14.1667ZM4.16667 14.1667C4.16667 15.0917 4.91667 15.8333 5.83333 15.8333H15.8333V7.5H5.83333C4.91667 7.5 4.16667 8.25 4.16667 9.16667V14.1667Z" fill="#ffffff"/>
</svg>
export const WalletIcon = ({ className }: { className?: string }) => (
<svg
className={className}
width='20'
height='20'
viewBox='0 0 20 20'
xmlns='http://www.w3.org/2000/svg'
>
<title>Wallet</title>
<path
d='M12.9167 12.9167C13.6083 12.9167 14.1667 12.3583 14.1667 11.6667C14.1667 10.975 13.6083 10.4167 12.9167 10.4167C12.225 10.4167 11.6667 10.975 11.6667 11.6667C11.6667 12.3583 12.225 12.9167 12.9167 12.9167ZM5.83333 2.5H14.1667C15.0917 2.5 15.8333 3.25 15.8333 4.16667V5.83333C16.7583 5.83333 17.5 6.58333 17.5 7.5V15.8333C17.5 16.7583 16.7583 17.5 15.8333 17.5H5.83333C3.99167 17.5 2.5 16.0083 2.5 14.1667V5.83333C2.5 3.99167 3.99167 2.5 5.83333 2.5ZM14.1667 5.83333V4.16667H5.83333C4.91667 4.16667 4.16667 4.91667 4.16667 5.83333V6.28333C4.65833 6 5.225 5.83333 5.83333 5.83333H14.1667ZM4.16667 14.1667C4.16667 15.0917 4.91667 15.8333 5.83333 15.8333H15.8333V7.5H5.83333C4.91667 7.5 4.16667 8.25 4.16667 9.16667V14.1667Z'
fill='currentColor'
/>
</svg>
);
Loading