Skip to content

Commit 53ffcca

Browse files
committed
Reimplement mono fonts
1 parent 200c665 commit 53ffcca

File tree

10 files changed

+25
-25
lines changed

10 files changed

+25
-25
lines changed

src/app/components/Account/AccountLink.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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">
158+
<div className="flex items-center flex-wrap gap-1 font-mono font-medium">
159159
<span className="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/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,
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-medium', !labelOnly && 'text-primary')}>
6466
{isTablet ? (
6567
<TabletLink address={address} name={name} to={to} labelOnly={labelOnly} trimMode={trimMode} />
6668
) : (

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const RoflAppsList: FC<RoflAppsListProps> = ({ isLoading, limit, paginati
6363
key: 'status',
6464
},
6565
{
66-
content: <RoflAppLink id={app.id} network={app.network} withSourceIndicator={false} />,
66+
content: <RoflAppLink id={app.id} network={app.network} withSourceIndicator={false} mono />,
6767
key: 'id',
6868
},
6969
{

src/app/components/Transactions/TransactionLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const WithTypographyAndLink: FC<{ children: ReactNode; mobile?: boolean; to: str
1515
mobile,
1616
to,
1717
}) => (
18-
<Link asChild className={cn('font-medium', mobile && 'max-w-[85%]')}>
18+
<Link asChild className={cn('font-mono font-medium', mobile && 'max-w-[85%]')}>
1919
<RouterLink to={to}>{children}</RouterLink>
2020
</Link>
2121
)

src/app/pages/RoflAppDetailsPage/InstancesList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const InstancesList: FC<InstancesListProps> = ({
5555
data: [
5656
{
5757
key: 'rak',
58-
content: <RoflAppInstanceLink id={appId} network={scope.network} rak={instance.rak} />,
58+
content: <RoflAppInstanceLink id={appId} network={scope.network} rak={instance.rak} mono />,
5959
},
6060
{
6161
key: 'node',

src/app/pages/RoflAppInstanceDetailsPage/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const RoflAppInstanceDetailsView: FC<{
7070
</div>
7171
</dt>
7272
<dd>
73-
<span>
73+
<span className="font-mono font-medium text-primary">
7474
{instance.rak} <CopyToClipboard value={instance.rak} />
7575
</span>
7676
</dd>
@@ -91,7 +91,7 @@ export const RoflAppInstanceDetailsView: FC<{
9191
<dd>{instance.expiration_epoch.toLocaleString()}</dd>
9292
<dt>{t('rofl.roflAppId')}</dt>
9393
<dd>
94-
<RoflAppLink id={appId} network={scope.network} withSourceIndicator={false} />
94+
<RoflAppLink id={appId} network={scope.network} withSourceIndicator={false} mono />
9595
<CopyToClipboard value={appId} />
9696
</dd>
9797
<dt>{t('rofl.endorsingNodeId')}</dt>

src/styles/tailwind.css

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import '@oasisprotocol/ui-library/src/styles/global.css';
22

33
@theme {
4+
--font-mono: 'Roboto Mono Variable', monospace;
45
--color-theme-surface: var(--color-theme-surface);
56
--color-theme-accent: var(--color-theme-accent);
67
--color-theme-accent-light: var(--color-theme-accent-light);
@@ -18,7 +19,7 @@
1819
--color-theme-contrast-main: #ffffff;
1920
}
2021

21-
.testnet {
22+
.testnet {
2223
--color-theme-surface: #fff0e4;
2324
--color-theme-accent: #ffa800;
2425
--color-theme-accent-light: #fff0e4;
@@ -42,11 +43,6 @@
4243

4344
/* Specific fixes needed during migration to Oasis UI Library */
4445

45-
/* Override MUI styles that are applied globally */
46-
[class*=' text-'] {
47-
font-family: 'Inter Variable', sans-serif;
48-
}
49-
5046
/* Override Tailwind's vertical-align reset for MUI SVG components */
5147
[class*='Mui'] img,
5248
[class*='Mui'] svg,

0 commit comments

Comments
 (0)