11import { FC } from 'react'
22import { useTranslation } from 'react-i18next'
3- import Box from '@mui/material/Box'
43import Card from '@mui/material/Card'
54import CardContent from '@mui/material/CardContent'
6- import Grid from '@mui/material/Unstable_Grid2'
7- import { styled } from '@mui/material/styles'
85import { Layer , Runtime } from '../../../oasis-nexus/api'
96import { CardHeaderWithCounter } from '../../components/CardHeaderWithCounter'
107import { isNotInHiddenScope , RouteUtils } from '../../utils/route-utils'
118import { SearchScope } from '../../../types/searchScope'
129import { EnabledRuntimePreview , DisabledRuntimePreview } from './RuntimePreview'
1310import { Network } from '../../../types/network'
1411import { Typography } from '@oasisprotocol/ui-library/src/components/typography'
12+ import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
1513
1614function 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-
3818type ParaTimesCardProps = { scope : SearchScope }
3919
4020export 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 )
0 commit comments