Skip to content

Commit ee557fb

Browse files
kaja-osojniklukaw3d
authored andcommitted
Reimplement mono fonts
1 parent a62f5f0 commit ee557fb

File tree

21 files changed

+53
-42
lines changed

21 files changed

+53
-42
lines changed

src/app/components/Account/AccountLink.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const WithTypographyAndLink: FC<{
2727
{labelOnly ? (
2828
<span className="text-foreground font-medium">{children}</span>
2929
) : (
30-
<Link asChild className="font-medium">
30+
<Link asChild className="font-mono font-medium">
3131
<RouterLink to={to}>{children}</RouterLink>
3232
</Link>
3333
)}
@@ -128,12 +128,12 @@ const TrimmedAccountLink: FC<
128128
<WithTypographyAndLink scope={scope} address={address} labelOnly={labelOnly}>
129129
<MaybeWithTooltip title={tooltipTitle}>
130130
{showAccountName ? (
131-
<span className="flex items-center gap-1">
131+
<span className="flex items-center gap-1 font-mono font-medium">
132132
<AccountMetadataSourceIndicator source={accountMetadata!.source} />{' '}
133133
{trimLongString(accountName, 12, 0)}
134134
</span>
135135
) : (
136-
trimLongString(address, 6, 6)
136+
<span className="font-mono font-medium">{trimLongString(address, 6, 6)}</span>
137137
)}
138138
</MaybeWithTooltip>
139139
</WithTypographyAndLink>
@@ -155,15 +155,15 @@ const DesktopAccountLink: FC<
155155
<WithTypographyAndLink scope={scope} address={address} labelOnly={labelOnly}>
156156
<MaybeWithTooltip title={tooltipTitle}>
157157
{showAccountName ? (
158-
<div className="flex items-center flex-wrap gap-1">
159-
<span className="inline-flex items-center gap-1">
158+
<div className="flex items-center flex-wrap gap-1 font-mono font-medium">
159+
<span className="font-sans inline-flex items-center gap-1">
160160
<AccountMetadataSourceIndicator source={accountMetadata!.source} />
161161
<HighlightedText text={accountName} />
162162
</span>
163163
({address})
164164
</div>
165165
) : (
166-
address
166+
<span className="font-mono font-medium">{address}</span>
167167
)}
168168
</MaybeWithTooltip>
169169
</WithTypographyAndLink>

src/app/components/Account/ConsensusAccountLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const ConsensusAccountLink: FC<ConsensusAccountLinkProps> = ({
2020
const { data } = useGetConsensusValidatorsAddressNameMap(network)
2121

2222
if (data?.data && address in data.data) {
23-
return <ValidatorLink address={address} network={network} alwaysTrim={alwaysTrim} />
23+
return <ValidatorLink address={address} network={network} alwaysTrim={alwaysTrim} mono={false} />
2424
}
2525

2626
return (

src/app/components/Blocks/BlockLink.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ export const BlockHashLink: FC<{
2727
// Table view
2828
return (
2929
<MaybeWithTooltip title={hash}>
30-
<Link asChild>
31-
<RouterLink to={to} className="text-primary font-medium">
32-
{trimLongString(hash)}
33-
</RouterLink>
30+
<Link asChild className="font-mono font-medium">
31+
<RouterLink to={to}>{trimLongString(hash)}</RouterLink>
3432
</Link>
3533
</MaybeWithTooltip>
3634
)
@@ -39,7 +37,7 @@ export const BlockHashLink: FC<{
3937
if (!isTablet) {
4038
// Desktop view
4139
return (
42-
<Link asChild className="font-medium">
40+
<Link asChild className="font-mono font-medium">
4341
<RouterLink to={to}>{hash}</RouterLink>
4442
</Link>
4543
)
@@ -48,8 +46,8 @@ export const BlockHashLink: FC<{
4846
// Mobile view
4947
return (
5048
<span className="max-w-full overflow-x-hidden">
51-
<Link asChild>
52-
<RouterLink to={to} className="text-primary font-medium">
49+
<Link asChild className="font-mono font-medium">
50+
<RouterLink to={to}>
5351
<AdaptiveTrimmer text={hash} strategy="middle" minLength={13} />
5452
</RouterLink>
5553
</Link>

src/app/components/Link/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type LinkProps = {
2222
to: string
2323
withSourceIndicator?: boolean
2424
labelOnly?: boolean
25+
mono?: boolean
2526
}
2627

2728
export const Link: FC<LinkProps> = ({
@@ -32,6 +33,7 @@ export const Link: FC<LinkProps> = ({
3233
to,
3334
withSourceIndicator = true,
3435
labelOnly,
36+
mono = true,
3537
}) => {
3638
const { isTablet } = useScreenSize()
3739
const hasName = name?.toLowerCase() !== address.toLowerCase()
@@ -60,7 +62,7 @@ export const Link: FC<LinkProps> = ({
6062
<MaybeWithTooltip title={tooltipTitle}>
6163
<div className="inline-flex items-center gap-1">
6264
{hasName && withSourceIndicator && <AccountMetadataSourceIndicator source={'SelfProfessed'} />}
63-
<span className={cn('font-medium', !labelOnly && 'text-primary')}>
65+
<span className={cn(mono ? 'font-mono' : 'font-sans', 'font-medium', !labelOnly && 'text-primary')}>
6466
{isTablet ? (
6567
<TabletLink address={address} name={name} to={to} labelOnly={labelOnly} trimMode={trimMode} />
6668
) : (

src/app/components/LongDataDisplay/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ export const LongDataDisplay: FC<{ data: string; fontWeight?: number; collapsedL
3636
<div>
3737
<span
3838
ref={textRef}
39-
className="
40-
font-medium
41-
overflow-hidden
42-
whitespace-pre-wrap
43-
"
39+
className="font-mono font-medium overflow-hidden whitespace-pre-wrap"
4440
style={{
4541
display: '-webkit-box',
4642
WebkitBoxOrient: 'vertical',

src/app/components/Rofl/RoflAppInstanceLink.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ type RoflAppInstanceLinkProps = {
88
id: string
99
network: Network
1010
rak: string
11+
mono?: boolean
1112
}
1213

13-
export const RoflAppInstanceLink: FC<RoflAppInstanceLinkProps> = ({ alwaysTrim, id, network, rak }) => {
14+
export const RoflAppInstanceLink: FC<RoflAppInstanceLinkProps> = ({ alwaysTrim, id, network, rak, mono }) => {
1415
const to = RouteUtils.getRoflAppInstanceRoute(network, id, rak)
1516

16-
return <Link address={rak} to={to} alwaysTrim={alwaysTrim} withSourceIndicator={false} />
17+
return <Link address={rak} to={to} alwaysTrim={alwaysTrim} withSourceIndicator={false} mono={mono} />
1718
}

src/app/components/Rofl/RoflAppLink.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type RoflAppLinkProps = {
1111
trimMode?: TrimMode
1212
withSourceIndicator?: boolean
1313
labelOnly?: boolean
14+
mono?: boolean
1415
}
1516

1617
export const RoflAppLink: FC<RoflAppLinkProps> = ({
@@ -21,6 +22,7 @@ export const RoflAppLink: FC<RoflAppLinkProps> = ({
2122
trimMode,
2223
withSourceIndicator,
2324
labelOnly,
25+
mono,
2426
}) => {
2527
const to = RouteUtils.getRoflAppRoute(network, id)
2628

@@ -33,6 +35,7 @@ export const RoflAppLink: FC<RoflAppLinkProps> = ({
3335
trimMode={trimMode}
3436
withSourceIndicator={withSourceIndicator}
3537
labelOnly={labelOnly}
38+
mono={mono}
3639
/>
3740
)
3841
}

src/app/components/Rofl/RoflAppsList.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ export const RoflAppsList: FC<RoflAppsListProps> = ({ isLoading, limit, paginati
5050
},
5151
{
5252
content: app?.metadata['net.oasis.rofl.name'] ? (
53-
<RoflAppLink id={app.id} name={app?.metadata['net.oasis.rofl.name']} network={app.network} />
53+
<RoflAppLink
54+
id={app.id}
55+
name={app?.metadata['net.oasis.rofl.name']}
56+
network={app.network}
57+
mono={false}
58+
/>
5459
) : (
5560
t('rofl.nameNotProvided')
5661
),
@@ -63,7 +68,7 @@ export const RoflAppsList: FC<RoflAppsListProps> = ({ isLoading, limit, paginati
6368
key: 'status',
6469
},
6570
{
66-
content: <RoflAppLink id={app.id} network={app.network} withSourceIndicator={false} />,
71+
content: <RoflAppLink id={app.id} network={app.network} withSourceIndicator={false} mono />,
6772
key: 'id',
6873
},
6974
{

src/app/components/RuntimeEvents/RuntimeEventDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ const RuntimeEventDetailsInner: FC<{
277277
<b>{eventName}</b>
278278
<br />
279279
{t('runtimeEvent.fields.topics')}:
280-
<span className="font-medium block whitespace-pre-wrap wrap-break-word">
280+
<span className="font-mono font-medium block whitespace-pre-wrap wrap-break-word">
281281
{event.body.topics
282282
/* @ts-expect-error -- Event body is missing types */
283283
.map((base64Topic, index) => {

src/app/components/TableCellNode/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ export const TableCellNode: FC<TableCellNodeProps> = ({ id, scope }) => {
2323
return <AccountLink alwaysTrimOnTablet scope={scope} address={getOasisAddressFromBase64PublicKey(id)} />
2424
}
2525

26-
return <span className="font-medium">{isTablet ? trimLongString(id) : id}</span>
26+
return <span className="font-mono font-medium">{isTablet ? trimLongString(id) : id}</span>
2727
}

0 commit comments

Comments
 (0)