Skip to content

Commit 74ea86b

Browse files
committed
Paratime Card grid update
1 parent b3dc945 commit 74ea86b

File tree

2 files changed

+31
-40
lines changed

2 files changed

+31
-40
lines changed

src/app/pages/ConsensusDashboardPage/ParaTimesCard.tsx

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,20 @@
11
import { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import Box from '@mui/material/Box'
43
import Card from '@mui/material/Card'
54
import CardContent from '@mui/material/CardContent'
6-
import Grid from '@mui/material/Unstable_Grid2'
7-
import { styled } from '@mui/material/styles'
85
import { Layer, Runtime } from '../../../oasis-nexus/api'
96
import { CardHeaderWithCounter } from '../../components/CardHeaderWithCounter'
107
import { isNotInHiddenScope, RouteUtils } from '../../utils/route-utils'
118
import { SearchScope } from '../../../types/searchScope'
129
import { EnabledRuntimePreview, DisabledRuntimePreview } from './RuntimePreview'
1310
import { Network } from '../../../types/network'
1411
import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
12+
import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
1513

1614
function shouldIncludeLayer(network: Network, layer: Layer) {
1715
return layer !== 'consensus' && isNotInHiddenScope({ network, layer })
1816
}
1917

20-
const StyledInnerGrid = styled(Grid)(({ theme }) => ({
21-
[theme.breakpoints.down('lg')]: {
22-
paddingTop: 0,
23-
},
24-
}))
25-
26-
const StyledBox = styled(Box)(({ theme }) => ({
27-
display: 'flex',
28-
[theme.breakpoints.down('lg')]: {
29-
flexDirection: 'column',
30-
gap: theme.spacing(4),
31-
},
32-
[theme.breakpoints.up('lg')]: {
33-
flexDirection: 'row',
34-
gap: theme.spacing(5),
35-
},
36-
}))
37-
3818
type ParaTimesCardProps = { scope: SearchScope }
3919

4020
export const ParaTimesCard: FC<ParaTimesCardProps> = ({ scope }) => {
@@ -57,25 +37,36 @@ export const ParaTimesCard: FC<ParaTimesCardProps> = ({ scope }) => {
5737
/>
5838
</Typography>
5939
<CardContent>
60-
<Grid container spacing={5}>
61-
<Grid xs={12} lg={spaceForSecondaryParaTimes ? 5 : 6}>
40+
<div className="grid grid-cols-12 gap-4">
41+
<div className={cn('col-span-12', spaceForSecondaryParaTimes ? 'lg:col-span-5' : 'lg:col-span-6')}>
6242
<EnabledRuntimePreview prominentItem network={scope.network} runtime={firstEnabledRuntime} />
63-
</Grid>
64-
<Grid xs={12} lg={spaceForSecondaryParaTimes ? 7 : 6} container>
65-
<StyledInnerGrid xs={12} lg={spaceForSecondaryParaTimes ? 9 : 8}>
66-
<StyledBox>
67-
{!!restEnabledRuntimes.length &&
68-
restEnabledRuntimes.map(runtime => (
69-
<EnabledRuntimePreview key={runtime} network={scope.network} runtime={runtime} />
70-
))}
71-
</StyledBox>
72-
</StyledInnerGrid>
73-
<StyledInnerGrid xs={12} lg={spaceForSecondaryParaTimes ? 3 : 4}>
74-
{!!disabledRuntimes.length &&
75-
disabledRuntimes.map(runtime => <DisabledRuntimePreview key={runtime} runtime={runtime} />)}
76-
</StyledInnerGrid>
77-
</Grid>
78-
</Grid>
43+
</div>
44+
45+
<div
46+
className={cn(
47+
'grid col-span-12 grid-cols-12 gap-x-4',
48+
spaceForSecondaryParaTimes ? 'lg:col-span-7' : 'lg:col-span-6',
49+
)}
50+
>
51+
<div
52+
className={cn('col-span-12', spaceForSecondaryParaTimes ? 'lg:col-span-9' : 'lg:col-span-6')}
53+
>
54+
<div className="flex flex-col gap-4 lg:flex-row lg:gap-5">
55+
{restEnabledRuntimes.map(runtime => (
56+
<EnabledRuntimePreview key={runtime} network={scope.network} runtime={runtime} />
57+
))}
58+
</div>
59+
</div>
60+
61+
<div
62+
className={cn('col-span-12', spaceForSecondaryParaTimes ? 'lg:col-span-3' : 'lg:col-span-6')}
63+
>
64+
{disabledRuntimes.map(runtime => (
65+
<DisabledRuntimePreview key={runtime} runtime={runtime} />
66+
))}
67+
</div>
68+
</div>
69+
</div>
7970
</CardContent>
8071
</Card>
8172
)

src/app/pages/ConsensusDashboardPage/RuntimePreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const StyledEnabledRuntime = styled(Box)(({ theme }) => ({
8282
borderBottom: `1px solid ${COLORS.grayMediumLight}`,
8383
},
8484
[theme.breakpoints.up('lg')]: {
85-
paddingRight: theme.spacing(5),
85+
paddingRight: theme.spacing(4),
8686
borderRight: `1px solid ${COLORS.grayMediumLight}`,
8787
},
8888
}))

0 commit comments

Comments
 (0)