From d37c0bf04fbb313338b8634f8b07c02b4732ea1d Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 12 Nov 2025 17:00:26 +0100 Subject: [PATCH] Remove usage of MUI SvgIcon --- .changelog/2341.internal.md | 1 + src/app/components/CustomIcons/ExplorerIcon.tsx | 8 ++++---- src/app/components/CustomIcons/Mainnet.tsx | 8 ++++---- src/app/components/CustomIcons/OasisIcon.tsx | 8 ++++---- src/app/components/CustomIcons/Testnet.tsx | 8 ++++---- src/app/components/PageLayout/Logotype.tsx | 11 +---------- .../pages/HomePage/Graph/GraphTooltipMobile/index.tsx | 2 +- src/app/utils/content.tsx | 8 ++++---- 8 files changed, 23 insertions(+), 31 deletions(-) create mode 100644 .changelog/2341.internal.md diff --git a/.changelog/2341.internal.md b/.changelog/2341.internal.md new file mode 100644 index 0000000000..26eb128198 --- /dev/null +++ b/.changelog/2341.internal.md @@ -0,0 +1 @@ +Remove usage of MUI SvgIcon diff --git a/src/app/components/CustomIcons/ExplorerIcon.tsx b/src/app/components/CustomIcons/ExplorerIcon.tsx index 625ad8abb4..d2c3a443f8 100644 --- a/src/app/components/CustomIcons/ExplorerIcon.tsx +++ b/src/app/components/CustomIcons/ExplorerIcon.tsx @@ -1,9 +1,9 @@ import { FC } from 'react' -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon' +import { cn } from '@oasisprotocol/ui-library/src/lib/utils' -export const ExplorerIcon: FC = props => { +export const ExplorerIcon: FC<{ className?: string }> = ({ className }) => { return ( - + @@ -24,6 +24,6 @@ export const ExplorerIcon: FC = props => { - + ) } diff --git a/src/app/components/CustomIcons/Mainnet.tsx b/src/app/components/CustomIcons/Mainnet.tsx index 5c7bb22939..d26eb2ded2 100644 --- a/src/app/components/CustomIcons/Mainnet.tsx +++ b/src/app/components/CustomIcons/Mainnet.tsx @@ -1,10 +1,10 @@ import { FC } from 'react' -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon' +import { cn } from '@oasisprotocol/ui-library/src/lib/utils' -export const MainnetIcon: FC = props => { +export const MainnetIcon: FC<{ className?: string }> = ({ className }) => { return ( - + - + ) } diff --git a/src/app/components/CustomIcons/OasisIcon.tsx b/src/app/components/CustomIcons/OasisIcon.tsx index de7b91f1e7..f713f3b371 100644 --- a/src/app/components/CustomIcons/OasisIcon.tsx +++ b/src/app/components/CustomIcons/OasisIcon.tsx @@ -1,10 +1,10 @@ import { FC } from 'react' -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon' +import { cn } from '@oasisprotocol/ui-library/src/lib/utils' -export const OasisIcon: FC = props => { +export const OasisIcon: FC<{ className?: string }> = ({ className }) => { return ( - + - + ) } diff --git a/src/app/components/CustomIcons/Testnet.tsx b/src/app/components/CustomIcons/Testnet.tsx index f192243ff2..aabf6b488c 100644 --- a/src/app/components/CustomIcons/Testnet.tsx +++ b/src/app/components/CustomIcons/Testnet.tsx @@ -1,10 +1,10 @@ import { FC } from 'react' -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon' +import { cn } from '@oasisprotocol/ui-library/src/lib/utils' -export const TestnetIcon: FC = props => { +export const TestnetIcon: FC<{ className?: string }> = ({ className }) => { return ( - + - + ) } diff --git a/src/app/components/PageLayout/Logotype.tsx b/src/app/components/PageLayout/Logotype.tsx index 5c971b3e6d..40b589390a 100644 --- a/src/app/components/PageLayout/Logotype.tsx +++ b/src/app/components/PageLayout/Logotype.tsx @@ -1,6 +1,5 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' -import { useScreenSize } from '../../hooks/useScreensize' import { Link as RouterLink } from 'react-router-dom' import { OasisIcon } from '../CustomIcons/OasisIcon' import { ExplorerIcon } from '../CustomIcons/ExplorerIcon' @@ -20,13 +19,5 @@ export const HomePageLink: FC = ({ showText }) => { } export const Logotype: FC = ({ showText }) => { - const { isMobile } = useScreenSize() - const oasisLogoSize = isMobile ? 32 : 40 - const logoSize = !showText ? { height: oasisLogoSize, width: oasisLogoSize } : { height: 40, width: 214 } - - return ( -
- {!showText ? : } -
- ) + return
{showText ? : }
} diff --git a/src/app/pages/HomePage/Graph/GraphTooltipMobile/index.tsx b/src/app/pages/HomePage/Graph/GraphTooltipMobile/index.tsx index bf454b09e5..a95a711566 100644 --- a/src/app/pages/HomePage/Graph/GraphTooltipMobile/index.tsx +++ b/src/app/pages/HomePage/Graph/GraphTooltipMobile/index.tsx @@ -105,7 +105,7 @@ interface GraphTooltipHeaderProps { const GraphTooltipHeader: FC = ({ disabled, network, area }) => { const { t } = useTranslation() - const icons = getNetworkIcons({ size: 38 }) + const icons = getNetworkIcons({ className: 'h-9 w-9' }) return (
=> ({ consensus: t('common.consensus'), }) -export const getNetworkIcons = ({ size }: { size?: number } = {}): Record => ({ - mainnet: , - testnet: , - localnet: , +export const getNetworkIcons = ({ className }: { className?: string } = {}): Record => ({ + mainnet: , + testnet: , + localnet: , })