Skip to content

Commit 46b2a1d

Browse files
authored
Merge pull request #2210 from oasisprotocol/kaja/uil-rofl-mono-typography
Kaja/uil rofl mono typography
2 parents 6269e3b + ba45c39 commit 46b2a1d

11 files changed

Lines changed: 16 additions & 26 deletions

File tree

.changelog/2210.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update mono fonts on ROFL app details page.

src/app/components/Account/AccountLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FC, ReactNode } from 'react'
22
import { Link as RouterLink } from 'react-router-dom'
33
import { useScreenSize } from '../../hooks/useScreensize'
4+
import { Link } from '@oasisprotocol/ui-library/src/components/link'
45
import { RouteUtils } from '../../utils/route-utils'
56
import InfoIcon from '@mui/icons-material/Info'
67
import { SearchScope } from '../../../types/searchScope'
@@ -13,7 +14,6 @@ import { AdaptiveHighlightedText } from '../HighlightedText/AdaptiveHighlightedT
1314
import { AdaptiveTrimmer } from '../AdaptiveTrimmer/AdaptiveTrimmer'
1415
import { AccountMetadataSourceIndicator } from './AccountMetadataSourceIndicator'
1516
import { WithHoverHighlighting } from '../HoverHighlightingContext/WithHoverHighlighting'
16-
import { Link } from '@oasisprotocol/ui-library/src/components/link'
1717

1818
const WithTypographyAndLink: FC<{
1919
scope: SearchScope

src/app/components/AdaptiveTrimmer/AdaptiveDynamicTrimmer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Box from '@mui/material/Box'
33
import InfoIcon from '@mui/icons-material/Info'
44
import { MaybeWithTooltip } from '../Tooltip/MaybeWithTooltip'
55
import { getAdaptiveId, ShorteningResult, useAdaptiveSizing } from './hooks'
6+
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
67

78
type AdaptiveDynamicTrimmerProps = {
89
/**
@@ -92,7 +93,7 @@ export const AdaptiveDynamicTrimmer: FC<AdaptiveDynamicTrimmerProps> = ({
9293
<Box component="span" ref={textRef} sx={{ maxWidth: '100%', overflowX: 'hidden' }}>
9394
<MaybeWithTooltip
9495
title={title}
95-
spanSx={{ textWrap: 'nowrap', whiteSpace: 'nowrap', opacity: isFinal ? 1 : 0 }}
96+
spanClassName={cn('whitespace-nowrap', isFinal ? 'opacity-100' : 'opacity-0')}
9697
>
9798
{currentContent}
9899
</MaybeWithTooltip>

src/app/components/Blocks/BlockLink.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ export const BlockHashLink: FC<{
3939
if (!isTablet) {
4040
// Desktop view
4141
return (
42-
<Link asChild>
43-
<RouterLink to={to} className="text-primary font-medium">
44-
{hash}
45-
</RouterLink>
42+
<Link asChild className="font-medium">
43+
<RouterLink to={to}>{hash}</RouterLink>
4644
</Link>
4745
)
4846
}

src/app/components/StyledDescriptionList/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export const StyledDescriptionList = styled(InlineDescriptionList, {
5959
alignItems: 'start',
6060
},
6161
dd: {
62-
color: COLORS.brandExtraDark,
6362
overflowWrap: 'anywhere',
6463
alignItems: 'center',
6564
maxWidth: '100%',

src/app/components/TableCellNode/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { FC } from 'react'
2-
import Typography from '@mui/material/Typography'
32
import { NodeDisplayType } from '../../../types/node-display-type'
43
import { SearchScope } from '../../../types/searchScope'
54
import { useScreenSize } from '../../hooks/useScreensize'
@@ -24,5 +23,5 @@ export const TableCellNode: FC<TableCellNodeProps> = ({ id, scope }) => {
2423
return <AccountLink alwaysTrimOnTablet scope={scope} address={getOasisAddressFromBase64PublicKey(id)} />
2524
}
2625

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

src/app/components/Tooltip/MaybeWithTooltip.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { FC, ReactNode } from 'react'
22
import Tooltip from '@mui/material/Tooltip'
33
import Box from '@mui/material/Box'
4-
import { SxProps } from '@mui/material/styles'
54
import { useScreenSize } from '../../hooks/useScreensize'
65

76
type MaybeWithTooltipProps = {
@@ -15,7 +14,7 @@ type MaybeWithTooltipProps = {
1514
/**
1615
* Any extra styles to apply to the span
1716
*/
18-
spanSx?: SxProps
17+
spanClassName?: string
1918

2019
/**
2120
* The content to show
@@ -26,8 +25,9 @@ type MaybeWithTooltipProps = {
2625
/**
2726
* A component to display some content with or without a tooltip
2827
*/
29-
export const MaybeWithTooltip: FC<MaybeWithTooltipProps> = ({ title, children, spanSx }) => {
28+
export const MaybeWithTooltip: FC<MaybeWithTooltipProps> = ({ title, children, spanClassName }) => {
3029
const { isMobile } = useScreenSize()
30+
3131
return (
3232
<Tooltip
3333
placement="top"
@@ -49,9 +49,7 @@ export const MaybeWithTooltip: FC<MaybeWithTooltipProps> = ({ title, children, s
4949
disableHoverListener={!title}
5050
disableTouchListener={!title}
5151
>
52-
<Box component="span" sx={{ display: 'inline-flex', ...spanSx }}>
53-
{children}
54-
</Box>
52+
<span className={spanClassName}>{children}</span>
5553
</Tooltip>
5654
)
5755
}

src/app/components/Transactions/TransactionLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FC, ReactNode } from 'react'
22
import { Link as RouterLink } from 'react-router-dom'
3+
import { Link } from '@oasisprotocol/ui-library/src/components/link'
34
import InfoIcon from '@mui/icons-material/Info'
45
import { useScreenSize } from '../../hooks/useScreensize'
56
import { RouteUtils } from '../../utils/route-utils'
@@ -9,7 +10,6 @@ import { MaybeWithTooltip } from '../Tooltip/MaybeWithTooltip'
910
import { trimLongString } from '../../utils/trimLongString'
1011
import Box from '@mui/material/Box'
1112
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
12-
import { Link } from '@oasisprotocol/ui-library/src/components/link'
1313

1414
const WithTypographyAndLink: FC<{ children: ReactNode; mobile?: boolean; to: string }> = ({
1515
children,

src/app/pages/RoflAppDetailsPage/Enclaves.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import Typography from '@mui/material/Typography'
43
import { RoflAppPolicy } from '../../../oasis-nexus/api'
54
import { CopyToClipboard } from 'app/components/CopyToClipboard'
65

@@ -21,9 +20,7 @@ export const Enclaves: FC<EnclavesProps> = ({ policy }) => {
2120
{policy.enclaves.map((enclave: string) => (
2221
<tr key={enclave}>
2322
<td>
24-
<Typography variant="mono" component="span">
25-
{enclave}
26-
</Typography>
23+
<span className="font-medium">{enclave}</span>
2724
</td>
2825
<td>
2926
<CopyToClipboard value={enclave} />

src/app/pages/RoflAppDetailsPage/GridRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const GridRow: FC<GridRowProps> = ({ label, children, tooltip }) => {
2525
</div>
2626

2727
<div className="col-span-2 border-b border-gray-100 p-2 md:p-4">
28-
{children ? <strong>{children}</strong> : t('common.missing')}
28+
{children ? <span className="font-medium">{children}</span> : t('common.missing')}
2929
</div>
3030
</>
3131
)

0 commit comments

Comments
 (0)