Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/2303.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Convert remaining MUI Typography.
10 changes: 3 additions & 7 deletions src/app/components/BalancesDiff/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
import BigNumber from 'bignumber.js'
import { COLORS } from '../../../styles/theme/colors'
import Typography from '@mui/material/Typography'
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
import { RoundedBalance } from '../RoundedBalance'
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'

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

return (
<Typography
sx={{
color: isNegative ? COLORS.error : COLORS.eucalyptus,
}}
>
<Typography className={cn(isNegative ? 'text-destructive' : 'text-success')}>
<RoundedBalance compactAllNumbers showSign value={result.toFixed()} ticker={ticker} />
</Typography>
)
Expand Down
9 changes: 1 addition & 8 deletions src/app/components/LayerPicker/LayerMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { FC, PropsWithChildren, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Typography from '@mui/material/Typography'
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
import { COLORS } from '../../../styles/theme/colors'
import { Layer } from '../../../oasis-nexus/api'
import { getLayerLabels } from '../../utils/content'
import { isScopeHidden, mergeNetworksInLayerSelector, RouteUtils } from '../../utils/route-utils'
Expand All @@ -20,12 +18,7 @@ type BaseLayerMenuItemProps = {
}

const LayerMenuItemCaption: FC<PropsWithChildren> = ({ children }) => (
<Typography
component="span"
sx={{ fontSize: '10px', fontStyle: 'italic', color: COLORS.grayMedium, ml: 2 }}
>
{children}
</Typography>
<span className="text-[10px] italic text-muted-foreground ml-1">{children}</span>
)

export const DisabledLayerMenuItem: FC<BaseLayerMenuItemProps> = ({ divider, targetScope }) => {
Expand Down
14 changes: 8 additions & 6 deletions src/app/components/LayerPicker/NetworkMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { FC, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Typography from '@mui/material/Typography'
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'
import { COLORS } from '../../../styles/theme/colors'
import { Network, getNetworkNames } from '../../../types/network'
import { RouteUtils } from '../../utils/route-utils'
import { getNetworkIcons } from '../../utils/content'
Expand Down Expand Up @@ -47,12 +45,16 @@ export const NetworkMenuItem: FC<NetworkMenuItemProps> = ({
<div className="flex-auto">
{labels[network]}
{isActive && (
<Typography
component="span"
sx={{ fontSize: '10px', fontStyle: 'italic', color: COLORS.grayMedium, ml: 2 }}
<span
className="
text-[10px]
italic
text-muted-foreground
ml-1
"
>
{t('layerPicker.active')}
</Typography>
</span>
)}
</div>
{network === selectedNetwork && <KeyboardArrowRightIcon />}
Expand Down
84 changes: 0 additions & 84 deletions src/app/components/Transactions/ConsensusTransactionDetails.tsx

This file was deleted.

112 changes: 0 additions & 112 deletions src/app/components/Transactions/TransactionDetailsElements.tsx

This file was deleted.

9 changes: 4 additions & 5 deletions src/app/components/charts/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TooltipProps } from 'recharts'
import Typography from '@mui/material/Typography'
import { COLORS } from 'styles/theme/colors'

export type Formatters = {
Expand Down Expand Up @@ -31,12 +30,12 @@ export const TooltipContent = ({
className="inline-flex flex-col px-5 py-3 shadow-lg rounded-lg text-white text-center"
style={{ backgroundColor: COLORS.spaceCadet }}
>
<Typography paragraph={false} sx={{ fontSize: 12 }}>
<span className="text-xs">
{formatters?.label ? formatters.label(payload[0].payload[labelKey]) : payload[0].payload[labelKey]}
</Typography>
<Typography paragraph={false} sx={{ fontSize: 12, fontWeight: 600 }}>
</span>
<span className="text-xs font-semibold">
{formatters?.data ? formatters.data(payload[0].value!, payload[0].payload.payload) : payload[0].value}
</Typography>
</span>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { TFunction } from 'i18next'
import Typography from '@mui/material/Typography'
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
import { Validator } from '../../../oasis-nexus/api'
import { SnapshotCard } from '../../components/Snapshots/SnapshotCard'
import { PieChart } from '../../components/charts/PieChart'
Expand Down Expand Up @@ -46,7 +46,7 @@ export const EscrowDistributionCard: FC<BalanceDistributionCardProps> = ({ valid
prependLegendList={
<>
{t('validator.totalEscrow')}
<Typography sx={{ fontSize: 10 }}>
<Typography variant="xsmall" className="text-inherit">
<RoundedBalance
compactLargeNumbers
value={validator.escrow.active_balance}
Expand Down
13 changes: 3 additions & 10 deletions src/app/pages/ValidatorDetailsPage/ExternalLinkCard.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
import Typography from '@mui/material/Typography'
import { styled } from '@mui/material/styles'
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
import OpenInNewIcon from '@mui/icons-material/OpenInNew'
import { getHostname } from '../../utils/url'
import { SnapshotCardExternalLink } from '../../components/Snapshots/SnapshotCardExternalLink'

const StyledTypography = styled(Typography)(() => ({
fontSize: 18,
fontWeight: 500,
textTransform: 'lowercase',
}))

type ExternalLinkCardProps = {
link: string | undefined
}
Expand All @@ -24,8 +17,8 @@ export const ExternalLinkCard: FC<ExternalLinkCardProps> = ({ link }) => {
description={t('validator.externalLinkDescription')}
label={
<div className="flex items-center gap-1">
<StyledTypography>{getHostname(link)}</StyledTypography>
<OpenInNewIcon sx={{ fontSize: 20 }} />
<Typography className="font-medium lowercase">{getHostname(link)}</Typography>
<OpenInNewIcon sx={{ fontSize: 15 }} />
</div>
}
title={t('validator.externalLink')}
Expand Down
5 changes: 2 additions & 3 deletions src/app/pages/ValidatorDetailsPage/UptimeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { useTranslation } from 'react-i18next'
import { SnapshotTextCard } from '../../components/Snapshots/SnapshotCard'
import { ValidatorUptime } from '../../../oasis-nexus/api'
import { UptimeStatus } from '../../components/UptimeStatus'
import Typography from '@mui/material/Typography'
import { COLORS } from 'styles/theme/colors'
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'

type UptimeCardProps = {
uptime?: ValidatorUptime
Expand All @@ -17,7 +16,7 @@ export const UptimeCard: FC<UptimeCardProps> = ({ uptime }) => {
<SnapshotTextCard title={t('validator.uptime')} withContentPadding={false}>
{uptime && (
<div className="flex flex-col mb-8">
<Typography sx={{ fontSize: 12, color: COLORS.grayMedium, textAlign: 'left', paddingBottom: 3 }}>
<Typography variant="xsmall" textColor="muted" className="font-normal text-left pb-2">
{t('validator.uptimeLast24')}
</Typography>
<div className="flex items-center justify-center mx-auto mt-2">
Expand Down
13 changes: 1 addition & 12 deletions src/app/pages/ValidatorDetailsPage/ValidatorTitleCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { FC } from 'react'
import Typography from '@mui/material/Typography'
import { CopyToClipboard } from '../../components/CopyToClipboard'
import { Validator } from '../../../oasis-nexus/api'
import { COLORS } from 'styles/theme/colors'
import { ValidatorImage } from 'app/components/Validators/ValidatorImage'
import { DetailsPageTitle } from 'app/components/PageLayout/DetailsPageTitle'
import { Network } from '../../../types/network'
Expand Down Expand Up @@ -56,16 +54,7 @@ export const ValidatorTitleCard: FC<ValidatorTitleCardProps> = ({ isLoading, net
<HighlightedText text={validator?.media?.name} />
)}
&nbsp;
<Typography
component="span"
sx={{
color: COLORS.grayMedium,
fontSize: '24px',
fontWeight: 400,
}}
>
({validator.rank})
</Typography>
<span className="text-muted-foreground text-2xl font-normal">({validator.rank})</span>
</div>
</>
)}
Expand Down
Loading