Skip to content

Commit daaae85

Browse files
authored
chore: links consistency (#81)
1 parent 1fb741a commit daaae85

18 files changed

+540
-107
lines changed

src/features/accounts/components/account-link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const AccountLink = fixedForwardRef(
2121
ref={ref}
2222
{...rest}
2323
>
24-
{children ? children : short ? ellipseAddress(address) : address}
24+
{children ? children : short ? <abbr title={address}>{ellipseAddress(address)}</abbr> : address}
2525
</TemplatedNavLink>
2626
)
2727
}

src/features/assets/components/asset-link.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ function Link(props: AssetIdLinkProps | AssetIdAndNameLinkProps) {
4444
)
4545
}
4646

47-
export function AssetLink({ asset, className }: AssetLinkProps) {
47+
export function AssetLink({ asset, className, ...rest }: AssetLinkProps) {
4848
return 'read' in asset ? (
4949
<RenderInlineAsyncAtom atom={asset}>
50-
{(asset) => <Link assetId={asset.id} assetName={asset.name} className={className} />}
50+
{(asset) => <Link assetId={asset.id} assetName={asset.name} className={className} {...rest} />}
5151
</RenderInlineAsyncAtom>
5252
) : (
53-
<Link assetId={asset.id} assetName={asset.name} className={className} />
53+
<Link assetId={asset.id} assetName={asset.name} className={className} {...rest} />
5454
)
5555
}
5656

57-
export function AssetIdAndNameLink({ assetId, assetName, className }: AssetIdAndNameLinkProps) {
58-
return <Link assetId={assetId} assetName={assetName} className={className} />
57+
export function AssetIdAndNameLink({ assetId, assetName, className, ...rest }: AssetIdAndNameLinkProps) {
58+
return <Link assetId={assetId} assetName={assetName} className={className} {...rest} />
5959
}
6060

61-
export function AssetIdLink({ assetId, className }: AssetIdLinkProps) {
62-
return <Link assetId={assetId} className={className} />
61+
export function AssetIdLink({ assetId, className, ...rest }: AssetIdLinkProps) {
62+
return <Link assetId={assetId} className={className} {...rest} />
6363
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Decimal from 'decimal.js'
44
import { Badge } from './badge'
55
import { AsyncMaybeAtom } from '../data/types'
66
import { RenderInlineAsyncAtom } from './render-inline-async-atom'
7+
import { AssetIdLink } from '@/features/assets/components/asset-link'
78

89
type Props = {
910
amount: number | bigint
@@ -19,7 +20,12 @@ const Amount = ({ asset, amount, isFrozen }: { asset: AssetSummary; amount: numb
1920

2021
return (
2122
<>
22-
{amountToDisplay} {asset.unitName ?? ''}
23+
{amountToDisplay}{' '}
24+
{asset.unitName ? (
25+
<AssetIdLink assetId={asset.id} className={cn('text-primary underline')}>
26+
{asset.unitName}
27+
</AssetIdLink>
28+
) : null}
2329
{isFrozen && <Badge variant="outline">Frozen</Badge>}
2430
</>
2531
)

src/features/common/mappers/to.ts

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

src/features/groups/components/group-link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function GroupLink({ round, groupId, short = false, className, children }
2020
urlTemplate={Urls.Explore.Block.ByRound.Group.ById}
2121
urlParams={{ round: round.toString(), groupId: encodeURIComponent(groupId) }}
2222
>
23-
{children ? children : short ? ellipseId(groupId) : groupId}
23+
{children ? children : short ? <abbr title={groupId}>{ellipseId(groupId)}</abbr> : groupId}
2424
</TemplatedNavLink>
2525
)
2626
}

src/features/transactions/components/__snapshots__/application-transaction-graph.INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA.html

Lines changed: 131 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@
1010
<h1
1111
class="text-l font-semibold"
1212
>
13-
AACC...EN4A
13+
<a
14+
class="text-primary underline"
15+
href="/explore/account/AACCDJTFPQR5UQJZ337NFR56CC44T776EWBGVJG5NY2QFTQWBWTALTEN4A"
16+
>
17+
<abbr
18+
title="AACCDJTFPQR5UQJZ337NFR56CC44T776EWBGVJG5NY2QFTQWBWTALTEN4A"
19+
>
20+
AACC...EN4A
21+
</abbr>
22+
</a>
1423
</h1>
1524
</div>
1625
<div
@@ -19,7 +28,12 @@
1928
<h1
2029
class="text-l font-semibold"
2130
>
22-
1201559522
31+
<a
32+
class="text-primary underline"
33+
href="/explore/application/1201559522"
34+
>
35+
1201559522
36+
</a>
2337
</h1>
2438
</div>
2539
<div
@@ -28,7 +42,16 @@
2842
<h1
2943
class="text-l font-semibold"
3044
>
31-
2PIF...RNMM
45+
<a
46+
class="text-primary underline"
47+
href="/explore/account/2PIFZW53RHCSFSYMCFUBW4XOCXOMB7XOYQSQ6KGT3KVGJTL4HM6COZRNMM"
48+
>
49+
<abbr
50+
title="2PIFZW53RHCSFSYMCFUBW4XOCXOMB7XOYQSQ6KGT3KVGJTL4HM6COZRNMM"
51+
>
52+
2PIF...RNMM
53+
</abbr>
54+
</a>
3255
</h1>
3356
</div>
3457
<div
@@ -37,7 +60,12 @@
3760
<h1
3861
class="text-l font-semibold"
3962
>
40-
1002541853
63+
<a
64+
class="text-primary underline"
65+
href="/explore/application/1002541853"
66+
>
67+
1002541853
68+
</a>
4169
</h1>
4270
</div>
4371
<div
@@ -46,7 +74,16 @@
4674
<h1
4775
class="text-l font-semibold"
4876
>
49-
FCHE...IYSM
77+
<a
78+
class="text-primary underline"
79+
href="/explore/account/FCHEP67BCAA64RTZZNHLOUJF22TDWPWKSWO4FDRLLHC3NMKCCMRCKPIYSM"
80+
>
81+
<abbr
82+
title="FCHEP67BCAA64RTZZNHLOUJF22TDWPWKSWO4FDRLLHC3NMKCCMRCKPIYSM"
83+
>
84+
FCHE...IYSM
85+
</abbr>
86+
</a>
5087
</h1>
5188
</div>
5289
<div
@@ -55,7 +92,16 @@
5592
<h1
5693
class="text-l font-semibold"
5794
>
58-
EOXL...GCE4
95+
<a
96+
class="text-primary underline"
97+
href="/explore/account/EOXLRDMDV4Y7GEWY5GEDCIJV7SQM3A3TBHYAPBTWHS7JTOOYHZXPUEGCE4"
98+
>
99+
<abbr
100+
title="EOXLRDMDV4Y7GEWY5GEDCIJV7SQM3A3TBHYAPBTWHS7JTOOYHZXPUEGCE4"
101+
>
102+
EOXL...GCE4
103+
</abbr>
104+
</a>
59105
</h1>
60106
</div>
61107
<div
@@ -64,7 +110,16 @@
64110
<h1
65111
class="text-l font-semibold"
66112
>
67-
IWT4...4RVY
113+
<a
114+
class="text-primary underline"
115+
href="/explore/account/IWT4WOUKYQBCAO76UKWZ5E4CPIJVLBE5R3NX5QH3BXMTG34WU7ZCLJ4RVY"
116+
>
117+
<abbr
118+
title="IWT4WOUKYQBCAO76UKWZ5E4CPIJVLBE5R3NX5QH3BXMTG34WU7ZCLJ4RVY"
119+
>
120+
IWT4...4RVY
121+
</abbr>
122+
</a>
68123
</h1>
69124
</div>
70125
<div
@@ -73,15 +128,29 @@
73128
<h1
74129
class="text-l font-semibold"
75130
>
76-
645869114
131+
<a
132+
class="text-primary underline"
133+
href="/explore/application/645869114"
134+
>
135+
645869114
136+
</a>
77137
</h1>
78138
</div>
79139
<div
80140
class="p-2 flex justify-center"
81141
>
82142
<h1
83143
class="text-l font-semibold"
84-
/>
144+
>
145+
<a
146+
class="text-primary underline"
147+
href="/explore/account/"
148+
>
149+
<abbr
150+
title=""
151+
/>
152+
</a>
153+
</h1>
85154
</div>
86155
<div
87156
class="absolute left-0"
@@ -183,7 +252,11 @@
183252
class="text-primary underline"
184253
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA"
185254
>
186-
INDQXWQ...
255+
<abbr
256+
title="INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA"
257+
>
258+
INDQXWQ...
259+
</abbr>
187260
</a>
188261
</div>
189262
<div
@@ -596,7 +669,14 @@
596669
>
597670
0.586582
598671

599-
USDC
672+
<span>
673+
<a
674+
class="text-primary underline"
675+
href="/explore/asset/31566704"
676+
>
677+
USDC
678+
</a>
679+
</span>
600680
</div>
601681
</div>
602682
<svg
@@ -709,7 +789,14 @@
709789
>
710790
0.586582
711791

712-
USDC
792+
<span>
793+
<a
794+
class="text-primary underline"
795+
href="/explore/asset/31566704"
796+
>
797+
USDC
798+
</a>
799+
</span>
713800
</div>
714801
</div>
715802
<svg
@@ -929,7 +1016,14 @@
9291016
>
9301017
146.5
9311018

932-
LTBX
1019+
<span>
1020+
<a
1021+
class="text-primary underline"
1022+
href="/explore/asset/408898501"
1023+
>
1024+
LTBX
1025+
</a>
1026+
</span>
9331027
</div>
9341028
</div>
9351029
<svg
@@ -1040,7 +1134,14 @@
10401134
>
10411135
146.5
10421136

1043-
LTBX
1137+
<span>
1138+
<a
1139+
class="text-primary underline"
1140+
href="/explore/asset/408898501"
1141+
>
1142+
LTBX
1143+
</a>
1144+
</span>
10441145
</div>
10451146
</div>
10461147
<svg
@@ -1259,7 +1360,14 @@
12591360
>
12601361
0.00017647
12611362

1262-
goETH
1363+
<span>
1364+
<a
1365+
class="text-primary underline"
1366+
href="/explore/asset/386195940"
1367+
>
1368+
goETH
1369+
</a>
1370+
</span>
12631371
</div>
12641372
</div>
12651373
<svg
@@ -1369,7 +1477,14 @@
13691477
>
13701478
0.00017647
13711479

1372-
goETH
1480+
<span>
1481+
<a
1482+
class="text-primary underline"
1483+
href="/explore/asset/386195940"
1484+
>
1485+
goETH
1486+
</a>
1487+
</span>
13731488
</div>
13741489
</div>
13751490
<svg

0 commit comments

Comments
 (0)