Skip to content

Commit 0723c10

Browse files
committed
Migrate layout icons to Lucide
1 parent 838dbfa commit 0723c10

File tree

10 files changed

+58
-23
lines changed

10 files changed

+58
-23
lines changed

.changelog/2384.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Migrate icons to Lucide

src/app/components/Balance/FiatMoneyAmount.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import WarningIcon from '@mui/icons-material/WarningAmber'
21
import { useTranslation } from 'react-i18next'
32
import { FC } from 'react'
43
import { CoinGeckoReferral } from '../CoinGeckoReferral'
54
import { FiatValueInfo } from './hooks'
65
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
76
import { Skeleton } from '@oasisprotocol/ui-library/src/components/ui/skeleton'
7+
import { TriangleAlert } from 'lucide-react'
88

99
export const FiatMoneyWarning: FC<{ unknownTickers: string[] }> = ({ unknownTickers }) => {
1010
const { t } = useTranslation()
1111
return (
1212
<Tooltip title={t('account.failedToLookUpTickers', { tickers: unknownTickers.join(', ') })}>
13-
<WarningIcon />
13+
<TriangleAlert />
1414
</Tooltip>
1515
)
1616
}

src/app/components/CardEmptyState/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, ReactNode } from 'react'
22
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
3-
import ReportProblemIcon from '@mui/icons-material/ReportProblem'
3+
import { TriangleAlert } from 'lucide-react'
44
import { COLORS } from '../../../styles/theme/colors'
55

66
type CardEmptyStateProps = {
@@ -10,7 +10,7 @@ type CardEmptyStateProps = {
1010

1111
export const CardEmptyState: FC<CardEmptyStateProps> = ({ label, action }) => (
1212
<div className="flex flex-col justify-center items-center flex-1 gap-3 text-center px-1 pt-8 pb-16 sm:px-4 sm:pt-16 sm:pb-32">
13-
<ReportProblemIcon sx={{ color: COLORS.warningColor, fontSize: '60px' }} />
13+
<TriangleAlert size={60} color={COLORS.warningColor} />
1414
<Typography className="block align-middle text-gray-700">
1515
{label}
1616
{action}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { FC } from 'react'
2+
import { Icon, IconNode } from 'lucide-react'
3+
4+
// From https://github.com/mui/material-ui/blob/4c336b8bd492749117a34947db44b0157a44c18b/packages/mui-icons-material/lib/esm/PivotTableChart.js#L6
5+
const pivotTableNode: IconNode = [
6+
[
7+
'path',
8+
{
9+
d: 'M10 8h11V5c0-1.1-.9-2-2-2h-9zM3 8h5V3H5c-1.1 0-2 .9-2 2zm2 13h3V10H3v9c0 1.1.9 2 2 2m8 1-4-4 4-4zm1-9 4-4 4 4zm.58 6H13v-2h1.58c1.33 0 2.42-1.08 2.42-2.42V13h2v1.58c0 2.44-1.98 4.42-4.42 4.42',
10+
11+
fill: 'currentColor',
12+
stroke: 'none',
13+
},
14+
],
15+
]
16+
17+
export const PivotTable: FC<{ className?: string; size?: number }> = ({ className, size = 24 }) => {
18+
return <Icon iconNode={pivotTableNode} size={size} className={className} />
19+
}

src/app/components/MuiIcons/X.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { FC } from 'react'
2+
import { Icon, IconNode } from 'lucide-react'
3+
4+
// From https://github.com/mui/material-ui/blob/4c336b8bd492749117a34947db44b0157a44c18b/packages/mui-icons-material/lib/esm/X.js#L6
5+
const xNode: IconNode = [
6+
[
7+
'path',
8+
{
9+
d: 'M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z',
10+
fill: 'currentColor',
11+
stroke: 'none',
12+
},
13+
],
14+
]
15+
16+
export const X: FC<{ className?: string; size?: number }> = ({ className, size = 24 }) => {
17+
return <Icon iconNode={xNode} size={size} className={className} />
18+
}

src/app/components/TableLayoutButton/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import { Button } from '@oasisprotocol/ui-library/src/components/ui/button'
4-
import PivotTableChartIcon from '@mui/icons-material/PivotTableChart'
54
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
5+
import { PivotTable } from '../MuiIcons/PivotTable'
66

77
export enum TableLayout {
88
Horizontal = 'horizontal',
@@ -21,13 +21,12 @@ export const TableLayoutButton: FC<TableLayoutButtonProps> = ({ tableView, setTa
2121
<Tooltip side="left" title={t('tableLayoutButton.changeView')}>
2222
<Button
2323
variant="ghost"
24-
size="icon"
2524
onClick={() => {
2625
setTableView(tableView === TableLayout.Horizontal ? TableLayout.Vertical : TableLayout.Horizontal)
2726
}}
2827
className="hover:bg-black/[0.04]"
2928
>
30-
<PivotTableChartIcon fontSize="medium" />
29+
<PivotTable className="min-h-6 min-w-6" />
3130
</Button>
3231
</Tooltip>
3332
)

src/app/components/XProfileWidget/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import classes from './XProfileWidget.module.css'
3-
import XIcon from '@mui/icons-material/X'
3+
import { X } from '../MuiIcons/X'
44

55
export const XProfileWidget: React.FC<{ handle: string }> = ({ handle }) => {
66
// Clean the handle (remove '@' if present)
@@ -27,7 +27,7 @@ export const XProfileWidget: React.FC<{ handle: string }> = ({ handle }) => {
2727
</div>
2828
</div>
2929
at
30-
<XIcon />
30+
<X />
3131
</div>
3232
</a>
3333
)

src/app/pages/ConsensusDashboardPage/RuntimePreview.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import { useTranslation } from 'react-i18next'
44
import { Button } from '@oasisprotocol/ui-library/src/components/ui/button'
55
import { Link } from '@oasisprotocol/ui-library/src/components/link'
66
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
7-
import FilterNoneIcon from '@mui/icons-material/FilterNone'
8-
import RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked'
7+
import { CircleOff } from 'lucide-react'
98
import { Runtime, useGetRuntimeStatus } from 'oasis-nexus/api'
10-
import { COLORS } from '../../../styles/theme/colors'
119
import { useRuntimeFreshness } from '../../components/OfflineBanner/hook'
1210
import { BlockLink } from '../../components/Blocks/BlockLink'
1311
import { RouterLinkCircle } from '../../components/StyledLinks'
@@ -243,7 +241,7 @@ const PanelButton: FC<PanelButtonProps> = ({ activePanel, ariaLabel, panel, setP
243241
{panel === activePanel ? (
244242
<div className="rounded-full w-[10px] h-[10px] bg-chart-5" />
245243
) : (
246-
<RadioButtonUncheckedIcon sx={{ color: COLORS.brandDark, fontSize: '10px' }} />
244+
<div className="rounded-full w-[10px] h-[10px] border border-chart-5" />
247245
)}
248246
</Button>
249247
)
@@ -266,10 +264,10 @@ const ChartsContainer: FC<ChartsContainerProps> = ({ children, status }) => {
266264
<div className="flex flex-1 flex-col items-center gap-2">
267265
{status && <div className="w-full">{children}</div>}
268266
{!status && (
269-
<>
270-
<FilterNoneIcon sx={{ color: COLORS.brandDark, fontSize: '33px' }} />
267+
<span className="flex flex-col gap-2 items-center text-center text-muted-foreground">
268+
<CircleOff size={30} className="text-muted-foreground" />
271269
{t('paratimes.noData')}
272-
</>
270+
</span>
273271
)}
274272
</div>
275273
</div>

src/app/pages/ParatimeDashboardPage/Nodes.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
4-
import OfflineBoltIcon from '@mui/icons-material/OfflineBolt'
4+
import { Zap } from 'lucide-react'
55
import { Info } from 'lucide-react'
66
import { SnapshotCard } from '../../components/Snapshots/SnapshotCard'
7-
import { COLORS } from '../../../styles/theme/colors'
87
import { useGetRuntimeStatus } from '../../../oasis-nexus/api'
98
import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip'
109
import { RuntimeScope } from '../../../types/searchScope'
@@ -27,7 +26,9 @@ export const Nodes: FC<{ scope: RuntimeScope }> = ({ scope }) => {
2726
<div className="flex items-center justify-center h-full">
2827
{isFetched && activeNodes !== undefined && (
2928
<>
30-
<OfflineBoltIcon fontSize="large" sx={{ color: COLORS.eucalyptus, mr: 3 }} />
29+
<div className="rounded-full w-8 h-8 bg-[#4cd4a9] flex items-center justify-center mr-4">
30+
<Zap color="white" size={20} />
31+
</div>
3132
<Typography className="text-primary text-center text-2xl font-semibold">
3233
{t('nodes.value', { value: activeNodes })}
3334
</Typography>
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import DataObjectIcon from '@mui/icons-material/DataObject'
4-
import { COLORS } from '../../../styles/theme/colors'
3+
import { Braces } from 'lucide-react'
54

65
export const EmptyStateCard: FC = () => {
76
const { t } = useTranslation()
87

98
return (
109
<div className="flex flex-col justify-center items-center gap-2 min-h-[150px] sm:min-h-[200px]">
11-
<DataObjectIcon sx={{ color: COLORS.grayMedium, fontSize: 40, opacity: 0.5 }} />
12-
<span className="text-gray-500 font-semibold text-center opacity-50">{t('rofl.noData')}</span>
10+
<Braces className="text-sidebar-ring" />
11+
<span className="text-sidebar-ring font-semibold text-center">{t('rofl.noData')}</span>
1312
</div>
1413
)
1514
}

0 commit comments

Comments
 (0)