Skip to content

Commit dd732f5

Browse files
committed
Update remaining MUI Typography instances
1 parent 5e4da54 commit dd732f5

File tree

9 files changed

+28
-59
lines changed

9 files changed

+28
-59
lines changed

src/app/components/BalancesDiff/index.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import BigNumber from 'bignumber.js'
4-
import { COLORS } from '../../../styles/theme/colors'
5-
import Typography from '@mui/material/Typography'
4+
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
65
import { RoundedBalance } from '../RoundedBalance'
6+
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
77

88
type BalancesDiffProps = {
99
before: string | undefined
@@ -22,11 +22,7 @@ export const BalancesDiff: FC<BalancesDiffProps> = ({ before, after, ticker }) =
2222
const isNegative = result.isNegative()
2323

2424
return (
25-
<Typography
26-
sx={{
27-
color: isNegative ? COLORS.error : COLORS.eucalyptus,
28-
}}
29-
>
25+
<Typography className={cn(isNegative ? 'text-destructive' : 'text-success')}>
3026
<RoundedBalance compactAllNumbers showSign value={result.toFixed()} ticker={ticker} />
3127
</Typography>
3228
)

src/app/components/ContractVerificationIcon/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { FC, useState } from 'react'
22
import { Trans, useTranslation } from 'react-i18next'
3-
import { COLORS } from '../../../styles/theme/colors'
43
import Link from '@mui/material/Link'
5-
import Typography from '@mui/material/Typography'
64
import { SearchScope } from '../../../types/searchScope'
75
import * as externalLinks from '../../utils/externalLinks'
86
import { isLocalnet } from '../../utils/route-utils'
@@ -45,7 +43,7 @@ export const VerificationIcon: FC<{
4543
</Link>
4644
{!hideLink &&
4745
(verificationLevel ? (
48-
<Typography component="span" sx={{ fontSize: '12px', color: COLORS.brandExtraDark }}>
46+
<span className="text-xs">
4947
&nbsp; &nbsp;
5048
<Trans
5149
t={t}
@@ -55,9 +53,9 @@ export const VerificationIcon: FC<{
5553
}}
5654
/>
5755
<AbiPlaygroundLink address_eth={address_eth} scope={scope} />
58-
</Typography>
56+
</span>
5957
) : (
60-
<Typography component="span" sx={{ fontSize: '12px', color: COLORS.brandExtraDark }}>
58+
<span className="text-xs">
6159
&nbsp; &nbsp;
6260
<Trans
6361
t={t}
@@ -67,7 +65,7 @@ export const VerificationIcon: FC<{
6765
}}
6866
/>{' '}
6967
{explainDelay && t('contract.verification.explainVerificationDelay')}
70-
</Typography>
68+
</span>
7169
))}
7270
</>
7371
)

src/app/components/LayerPicker/LayerMenu.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { FC, PropsWithChildren, useState } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import Typography from '@mui/material/Typography'
43
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'
54
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
6-
import { COLORS } from '../../../styles/theme/colors'
75
import { Layer } from '../../../oasis-nexus/api'
86
import { getLayerLabels } from '../../utils/content'
97
import { isScopeHidden, mergeNetworksInLayerSelector, RouteUtils } from '../../utils/route-utils'
@@ -20,12 +18,7 @@ type BaseLayerMenuItemProps = {
2018
}
2119

2220
const LayerMenuItemCaption: FC<PropsWithChildren> = ({ children }) => (
23-
<Typography
24-
component="span"
25-
sx={{ fontSize: '10px', fontStyle: 'italic', color: COLORS.grayMedium, ml: 2 }}
26-
>
27-
{children}
28-
</Typography>
21+
<span className="text-[10px] italic text-muted-foreground ml-1">{children}</span>
2922
)
3023

3124
export const DisabledLayerMenuItem: FC<BaseLayerMenuItemProps> = ({ divider, targetScope }) => {

src/app/components/LayerPicker/NetworkMenu.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { FC, useState } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import Typography from '@mui/material/Typography'
43
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'
5-
import { COLORS } from '../../../styles/theme/colors'
64
import { Network, getNetworkNames } from '../../../types/network'
75
import { RouteUtils } from '../../utils/route-utils'
86
import { getNetworkIcons } from '../../utils/content'
@@ -47,12 +45,16 @@ export const NetworkMenuItem: FC<NetworkMenuItemProps> = ({
4745
<div className="flex-auto">
4846
{labels[network]}
4947
{isActive && (
50-
<Typography
51-
component="span"
52-
sx={{ fontSize: '10px', fontStyle: 'italic', color: COLORS.grayMedium, ml: 2 }}
48+
<span
49+
className="
50+
text-[10px]
51+
italic
52+
text-muted-foreground
53+
ml-1
54+
"
5355
>
5456
{t('layerPicker.active')}
55-
</Typography>
57+
</span>
5658
)}
5759
</div>
5860
{network === selectedNetwork && <KeyboardArrowRightIcon />}

src/app/components/charts/Tooltip.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { TooltipProps } from 'recharts'
2-
import Typography from '@mui/material/Typography'
32
import { COLORS } from 'styles/theme/colors'
43

54
export type Formatters = {
@@ -31,12 +30,12 @@ export const TooltipContent = ({
3130
className="inline-flex flex-col px-5 py-3 shadow-lg rounded-lg text-white text-center"
3231
style={{ backgroundColor: COLORS.spaceCadet }}
3332
>
34-
<Typography paragraph={false} sx={{ fontSize: 12 }}>
33+
<span className="text-xs">
3534
{formatters?.label ? formatters.label(payload[0].payload[labelKey]) : payload[0].payload[labelKey]}
36-
</Typography>
37-
<Typography paragraph={false} sx={{ fontSize: 12, fontWeight: 600 }}>
35+
</span>
36+
<span className="text-xs font-semibold">
3837
{formatters?.data ? formatters.data(payload[0].value!, payload[0].payload.payload) : payload[0].value}
39-
</Typography>
38+
</span>
4039
</div>
4140
)
4241
}

src/app/pages/ValidatorDetailsPage/EscrowDistributionCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import { TFunction } from 'i18next'
4-
import Typography from '@mui/material/Typography'
4+
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
55
import { Validator } from '../../../oasis-nexus/api'
66
import { SnapshotCard } from '../../components/Snapshots/SnapshotCard'
77
import { PieChart } from '../../components/charts/PieChart'
@@ -46,7 +46,7 @@ export const EscrowDistributionCard: FC<BalanceDistributionCardProps> = ({ valid
4646
prependLegendList={
4747
<>
4848
{t('validator.totalEscrow')}
49-
<Typography sx={{ fontSize: 10 }}>
49+
<Typography variant="xsmall" className="text-inherit">
5050
<RoundedBalance
5151
compactLargeNumbers
5252
value={validator.escrow.active_balance}

src/app/pages/ValidatorDetailsPage/ExternalLinkCard.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import Typography from '@mui/material/Typography'
4-
import { styled } from '@mui/material/styles'
3+
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
54
import OpenInNewIcon from '@mui/icons-material/OpenInNew'
65
import { getHostname } from '../../utils/url'
76
import { SnapshotCardExternalLink } from '../../components/Snapshots/SnapshotCardExternalLink'
87

9-
const StyledTypography = styled(Typography)(() => ({
10-
fontSize: 18,
11-
fontWeight: 500,
12-
textTransform: 'lowercase',
13-
}))
14-
158
type ExternalLinkCardProps = {
169
link: string | undefined
1710
}
@@ -24,8 +17,8 @@ export const ExternalLinkCard: FC<ExternalLinkCardProps> = ({ link }) => {
2417
description={t('validator.externalLinkDescription')}
2518
label={
2619
<div className="flex items-center gap-1">
27-
<StyledTypography>{getHostname(link)}</StyledTypography>
28-
<OpenInNewIcon sx={{ fontSize: 20 }} />
20+
<Typography className="font-medium lowercase">{getHostname(link)}</Typography>
21+
<OpenInNewIcon sx={{ fontSize: 15 }} />
2922
</div>
3023
}
3124
title={t('validator.externalLink')}

src/app/pages/ValidatorDetailsPage/UptimeCard.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { useTranslation } from 'react-i18next'
33
import { SnapshotTextCard } from '../../components/Snapshots/SnapshotCard'
44
import { ValidatorUptime } from '../../../oasis-nexus/api'
55
import { UptimeStatus } from '../../components/UptimeStatus'
6-
import Typography from '@mui/material/Typography'
7-
import { COLORS } from 'styles/theme/colors'
6+
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
87

98
type UptimeCardProps = {
109
uptime?: ValidatorUptime
@@ -17,7 +16,7 @@ export const UptimeCard: FC<UptimeCardProps> = ({ uptime }) => {
1716
<SnapshotTextCard title={t('validator.uptime')} withContentPadding={false}>
1817
{uptime && (
1918
<div className="flex flex-col mb-8">
20-
<Typography sx={{ fontSize: 12, color: COLORS.grayMedium, textAlign: 'left', paddingBottom: 3 }}>
19+
<Typography variant="xsmall" textColor="muted" className="font-normal text-left pb-2">
2120
{t('validator.uptimeLast24')}
2221
</Typography>
2322
<div className="flex items-center justify-center mx-auto mt-2">

src/app/pages/ValidatorDetailsPage/ValidatorTitleCard.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { FC } from 'react'
2-
import Typography from '@mui/material/Typography'
32
import { CopyToClipboard } from '../../components/CopyToClipboard'
43
import { Validator } from '../../../oasis-nexus/api'
5-
import { COLORS } from 'styles/theme/colors'
64
import { ValidatorImage } from 'app/components/Validators/ValidatorImage'
75
import { DetailsPageTitle } from 'app/components/PageLayout/DetailsPageTitle'
86
import { Network } from '../../../types/network'
@@ -56,16 +54,7 @@ export const ValidatorTitleCard: FC<ValidatorTitleCardProps> = ({ isLoading, net
5654
<HighlightedText text={validator?.media?.name} />
5755
)}
5856
&nbsp;
59-
<Typography
60-
component="span"
61-
sx={{
62-
color: COLORS.grayMedium,
63-
fontSize: '24px',
64-
fontWeight: 400,
65-
}}
66-
>
67-
({validator.rank})
68-
</Typography>
57+
<span className="text-muted-foreground text-2xl font-normal">({validator.rank})</span>
6958
</div>
7059
</>
7160
)}

0 commit comments

Comments
 (0)