Skip to content

Commit 9ded4ef

Browse files
authored
chore: enhance the transaction visual UI (#104)
1 parent 5872cc9 commit 9ded4ef

23 files changed

+3548
-3054
lines changed

src/assets/svg/circle.svg

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/assets/svg/pointer-left.svg

Lines changed: 2 additions & 2 deletions
Loading

src/assets/svg/pointer-right.svg

Lines changed: 4 additions & 4 deletions
Loading

src/features/common/components/display-algo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export type Props = {
99

1010
export function DisplayAlgo({ className, amount }: Props) {
1111
return (
12-
<div className={cn(className, 'inline-flex gap-0.5')}>
12+
<div className={cn('inline-flex gap-0.5', className)}>
1313
{amount.algos}
1414
<SvgAlgorand className="h-auto w-2.5" />
1515
</div>

src/features/common/components/display-asset-amount.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ type Props = {
1111
asset: AssetSummary | AsyncMaybeAtom<AssetSummary>
1212
isFrozen?: boolean
1313
className?: string
14+
linkClassName?: string
1415
}
1516

16-
const Amount = ({ asset, amount, isFrozen }: { asset: AssetSummary; amount: number | bigint; isFrozen?: boolean }) => {
17+
type AmountProps = {
18+
asset: AssetSummary
19+
amount: number | bigint
20+
isFrozen?: boolean
21+
linkClassName?: string
22+
}
23+
const Amount = ({ asset, amount, isFrozen, linkClassName }: AmountProps) => {
1724
// asset decimals value must be from 0 to 19 so it is safe to use .toString() here
1825
// the amount is uint64, should be safe to be .toString()
1926
const amountToDisplay = new Decimal(amount.toString()).div(new Decimal(10).pow(asset.decimals)).toString()
@@ -22,7 +29,7 @@ const Amount = ({ asset, amount, isFrozen }: { asset: AssetSummary; amount: numb
2229
<div className="flex items-center gap-1">
2330
<span>{amountToDisplay}</span>
2431
{asset.unitName ? (
25-
<AssetIdLink assetId={asset.id} className={cn('text-primary underline')}>
32+
<AssetIdLink assetId={asset.id} className={cn('underline', linkClassName ?? 'text-primary')}>
2633
{asset.unitName}
2734
</AssetIdLink>
2835
) : undefined}
@@ -31,15 +38,15 @@ const Amount = ({ asset, amount, isFrozen }: { asset: AssetSummary; amount: numb
3138
)
3239
}
3340

34-
export const DisplayAssetAmount = ({ amount, asset, isFrozen, className }: Props) => {
41+
export const DisplayAssetAmount = ({ amount, asset, isFrozen, className, linkClassName }: Props) => {
3542
return (
3643
<div className={cn(className)}>
3744
{'read' in asset ? (
3845
<RenderInlineAsyncAtom atom={asset}>
39-
{(asset) => <Amount asset={asset} amount={amount} isFrozen={isFrozen} />}
46+
{(asset) => <Amount asset={asset} amount={amount} isFrozen={isFrozen} linkClassName={linkClassName} />}
4047
</RenderInlineAsyncAtom>
4148
) : (
42-
<Amount asset={asset} amount={amount} isFrozen={isFrozen} />
49+
<Amount asset={asset} amount={amount} isFrozen={isFrozen} linkClassName={linkClassName} />
4350
)}
4451
</div>
4552
)

src/features/common/components/svg/circle.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/features/common/components/svg/pointer-left.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ import type { SVGProps } from 'react'
22
const SvgPointerLeft = (props: SVGProps<SVGSVGElement>) => (
33
<svg
44
xmlnsXlink="http://www.w3.org/1999/xlink"
5-
width="11px"
6-
height="19px"
5+
width="20px"
6+
height="20px"
77
preserveAspectRatio="xMinYMid meet"
8-
viewBox="159 229 7 10"
8+
viewBox="0 0 20 20"
99
xmlns="http://www.w3.org/2000/svg"
1010
{...props}
1111
>
1212
<path
13-
d="M 165.8 228.1 L 159.1 234.1 L 165.8 240.1 L 163.5 234.1 L 165.8 228.1 Z"
13+
d="M 14 15 L 20 10 L 14 5 L 14 10 L 14 16 Z"
1414
fillRule="nonzero"
1515
fill="currentColor"
1616
stroke="none"
17+
transform="scale(-1, 1) translate(-20, 0)"
1718
/>
1819
</svg>
1920
)

src/features/common/components/svg/pointer-right.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import type { SVGProps } from 'react'
22
const SvgPointerRight = (props: SVGProps<SVGSVGElement>) => (
33
<svg
44
xmlnsXlink="http://www.w3.org/1999/xlink"
5-
width="11px"
6-
height="19px"
5+
width="20px"
6+
height="20px"
77
preserveAspectRatio="xMinYMid meet"
8-
viewBox="340 139 1 13"
8+
viewBox="0 0 20 20"
99
xmlns="http://www.w3.org/2000/svg"
1010
{...props}
1111
>
12-
<path d="M 340.3 151.3 L 347 145.3 L 340.3 139.3 L 342.6 145.3 L 340.3 151.3 Z" fillRule="nonzero" fill="currentColor" stroke="none" />
12+
<path d="M 14 15 L 20 10 L 14 5 L 14 10 L 14 16 Z" fillRule="nonzero" fill="currentColor" stroke="none" />
1313
</svg>
1414
)
1515
export default SvgPointerRight

0 commit comments

Comments
 (0)