Skip to content

Commit ac43fac

Browse files
authored
Merge pull request #2351 from oasisprotocol/mz/mui
Remove MUI themes and eslint rules
2 parents b6d3bac + 8ac5c58 commit ac43fac

21 files changed

Lines changed: 12 additions & 633 deletions

File tree

.changelog/2351.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove MUI themes and eslint rules

.eslintrc.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ const config = {
2121
'error',
2222
{
2323
paths: [
24-
{
25-
name: '@mui/material',
26-
message: "Use '@mui/material/*' instead.",
27-
},
28-
{
29-
name: '@mui/icons-material',
30-
message: "Use '@mui/icons-material/*' instead.",
31-
},
3224
{
3325
name: 'date-fns',
3426
message: "Use 'date-fns/*' instead.",
@@ -43,10 +35,6 @@ const config = {
4335
},
4436
],
4537
patterns: [
46-
{
47-
group: ['@mui/system', '@emotion/styled'],
48-
message: "Use '@mui/material/styles' instead.",
49-
},
5038
{
5139
group: ['**/oasis-nexus/generated/api'],
5240
message: "Import 'oasis-nexus/api' instead.",

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@fontsource-variable/roboto-mono": "^5.0.17",
5353
"@metamask/jazzicon": "2.0.0",
5454
"@monaco-editor/react": "^4.7.0",
55-
"@mui/base": "5.0.0-beta.61",
5655
"@mui/icons-material": "5.16.7",
5756
"@mui/material": "5.16.7",
5857
"@oasisprotocol/client": "1.2.0",

src/app/components/AccountAvatar/InitialsAvatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const InitialsAvatar = ({
2525
return (
2626
<svg width={width} viewBox="0 0 100 100" style={style}>
2727
<rect width="100" height="100" rx="50" fill={COLORS.brandDark} />
28-
<text fontSize="40" x="50" y="50" dominantBaseline="central" textAnchor="middle" fill={COLORS.white}>
28+
<text fontSize="40" x="50" y="50" dominantBaseline="central" textAnchor="middle" fill="#ffffff">
2929
{extractTwoChars(name)}
3030
</text>
3131
</svg>

src/app/components/ThemeByScope/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import { FC, ReactNode } from 'react'
22
import { Network } from '../../../types/network'
3-
import { ThemeProvider } from '@mui/material/styles'
4-
import { getThemeForScope } from '../../../styles/theme'
53
import { fixedNetwork } from '../../utils/route-utils'
64
import { Layer } from '../../../oasis-nexus/api'
75

86
export const ThemeByScope: FC<{
97
network: Network
108
layer?: Layer
119
children: React.ReactNode
12-
}> = ({ network, layer, children }) => (
13-
<ThemeProvider theme={getThemeForScope(network, layer)}>
14-
<div className={network}>{children}</div>
15-
</ThemeProvider>
16-
)
10+
}> = ({ network, children }) => <div className={network}>{children}</div>
1711

1812
export const withDefaultTheme = (node: ReactNode, alwaysMainnet = false) => (
1913
<ThemeByScope network={alwaysMainnet ? 'mainnet' : (fixedNetwork ?? 'mainnet')}>{node}</ThemeByScope>

src/app/components/UptimeStatus/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ export const UptimeStatus: FC<UptimeStatusProps> = ({ uptime, small }) => {
4343
<div
4444
key={`${value}-${index}`}
4545
className={cn(
46-
'inline-block',
4746
small
4847
? 'w-[3px] min-w-[3px] h-[15px] rounded-[2px] mr-[1px]'
4948
: 'w-[7px] min-w-[7px] rounded-[4px] mr-[2px]',
5049
)}
5150
style={{
5251
backgroundColor: getUptimeItemColor(value),
53-
color: COLORS.white,
5452
height: `${Math.round((value * 45) / 1200)}px`,
5553
}}
5654
/>

src/app/components/charts/PieChart.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useTranslation } from 'react-i18next'
44
import CircleIcon from '@mui/icons-material/Circle'
55
import { TooltipContent, type Formatters } from './Tooltip'
66
import { COLORS } from '../../../styles/theme/colors'
7-
import { COLORS as TESTNET_COLORS } from '../../../styles/theme/testnet/colors'
87
import { Props } from 'recharts/types/component/DefaultLegendContent'
98
import { PieSectorDataItem } from 'recharts/types/polar/Pie'
109
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
@@ -16,7 +15,7 @@ interface PieChartProps<T extends object> extends Formatters {
1615
prependLegendList?: ReactNode
1716
}
1817

19-
const colorPalette = [COLORS.brandDark, COLORS.brandMedium, TESTNET_COLORS.testnet, COLORS.grayMedium2]
18+
const colorPalette = ['#0500E2', '#0092f6', '#ffa800', '#d5d6d7']
2019

2120
type LegendListItemProps = {
2221
children: ReactNode

src/app/pages/NFTInstanceDashboardPage/InstanceImageCard.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import OpenInFullIcon from '@mui/icons-material/OpenInFull'
1010
import { EvmNft } from 'oasis-nexus/api'
1111
import { processNftImageUrl } from '../../utils/nft-images'
1212
import { isUrlSafe } from '../../utils/url'
13-
import { COLORS } from '../../../styles/theme/colors'
1413
import { ImagePreview } from '../../components/ImagePreview'
1514
import { NoPreview } from '../../components/NoPreview'
1615
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
@@ -78,17 +77,9 @@ export const InstanceImageCard: FC<InstanceImageCardProps> = ({ isFetched, isLoa
7877
const [imageLoadError, setImageLoadError] = useState(false)
7978

8079
return (
81-
<Card
82-
variant="layout"
83-
style={{
84-
background: darkMode ? COLORS.grayExtraDark : COLORS.white,
85-
}}
86-
>
80+
<Card variant="layout" className={cn(darkMode ? 'bg-gray-900' : 'bg-white')}>
8781
<CardContent>
88-
<div
89-
className={cn('flex flex-col items-center justify-between', darkMode ? 'bg-gray-900' : 'bg-white')}
90-
style={{ minHeight: imageSize }}
91-
>
82+
<div className="flex flex-col items-center justify-between" style={{ minHeight: imageSize }}>
9283
{isLoading && <Skeleton className="w-[350px] h-[350px]" />}
9384
{/* API did not process NFT data fully */}
9485
{isFetched && !nft?.image && <NoPreview placeholderSize={imageSize} />}

src/app/pages/RuntimeAccountDetailsPage/Staking.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 { Card, CardContent, CardHeader, CardTitle } from '@oasisprotocol/ui-library/src/components/cards'
4-
import Link from '@mui/material/Link'
4+
import { Link } from '@oasisprotocol/ui-library/src/components/link'
55
import { Skeleton } from '@oasisprotocol/ui-library/src/components/ui/skeleton'
66
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@oasisprotocol/ui-library/src/components/tabs'
77
import {
@@ -79,7 +79,7 @@ const ActiveDelegations: FC<DelegationCardProps> = ({ address }) => {
7979
if (isFetched && !delegationsQuery.data?.data.delegations.length) {
8080
return (
8181
<AccountCardEmptyState label={t('account.notStaking')}>
82-
<Link href={dapps.stake} rel="noopener noreferrer" target="_blank">
82+
<Link className="font-semibold" href={dapps.stake} rel="noopener noreferrer" target="_blank">
8383
{t('account.startStaking')}
8484
</Link>
8585
</AccountCardEmptyState>

src/app/pages/SearchResultsPage/ExploreOasisButton.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useNavigate } from 'react-router-dom'
22
import { FC, useCallback } from 'react'
3-
import { Button } from '@mui/base/Button'
3+
import { Button } from '@oasisprotocol/ui-library/src/components/ui/button'
44
import ArrowForward from '@mui/icons-material/ArrowForward'
55
import { useTranslation } from 'react-i18next'
66

@@ -9,15 +9,7 @@ export const ExploreOasisButton: FC = () => {
99
const navigate = useNavigate()
1010
const explore = useCallback(() => navigate('/'), [navigate])
1111
return (
12-
<Button
13-
style={{
14-
marginTop: '2em',
15-
paddingLeft: '1em',
16-
paddingRight: '1em',
17-
height: '3em',
18-
}}
19-
onClick={explore}
20-
>
12+
<Button variant="ghost" className="mt-8" size="lg" onClick={explore}>
2113
<div className="flex items-center gap-1">
2214
{t('home.exploreBtnText')}
2315
<ArrowForward fontSize={'small'} />

0 commit comments

Comments
 (0)