11import { FC , ReactNode , useState } from 'react'
22import { Link as RouterLink } from 'react-router-dom'
33import { useTranslation } from 'react-i18next'
4- import Box from '@mui/material/Box'
54import { Button } from '@oasisprotocol/ui-library/src/components/ui/button'
65import Link from '@mui/material/Link'
76import Typography from '@mui/material/Typography'
@@ -38,18 +37,6 @@ const StyledList = styled(InlineDescriptionList)(({ theme }) => ({
3837 } ,
3938} ) )
4039
41- const StyledBox = styled ( Box ) ( ( ) => ( {
42- border : `2px solid ${ COLORS . brandDark } ` ,
43- borderRadius : '12px' ,
44- height : '180px' ,
45- display : 'flex' ,
46- flex : 1 ,
47- justifyContent : 'center' ,
48- alignItems : 'center' ,
49- boxShadow : '0px 34px 24px -9px #324DAB1F' ,
50- overflow : 'hidden' ,
51- } ) )
52-
5340const StyledTypography = styled ( Typography ) ( ( ) => ( {
5441 fontSize : '18px' ,
5542 fontWeight : 700 ,
@@ -60,33 +47,6 @@ const StyledTypography = styled(Typography)(() => ({
6047 alignItems : 'center' ,
6148} ) )
6249
63- const StyledDisabledRuntime = styled ( Box ) ( ( { theme } ) => ( {
64- display : 'flex' ,
65- gap : 3 ,
66- paddingTop : theme . spacing ( 3 ) ,
67- flexDirection : 'row' ,
68- alignItems : 'center' ,
69- [ theme . breakpoints . between ( 'md' , 'xl' ) ] : {
70- flexDirection : 'column' ,
71- alignItems : 'flex-start' ,
72- } ,
73- } ) )
74-
75- const StyledEnabledRuntime = styled ( Box ) ( ( { theme } ) => ( {
76- flex : 1 ,
77- height : '100%' ,
78- paddingTop : theme . spacing ( 3 ) ,
79- paddingBottom : theme . spacing ( 3 ) ,
80- [ theme . breakpoints . down ( 'lg' ) ] : {
81- paddingBottom : theme . spacing ( 5 ) ,
82- borderBottom : `1px solid ${ COLORS . grayMediumLight } ` ,
83- } ,
84- [ theme . breakpoints . up ( 'lg' ) ] : {
85- paddingRight : theme . spacing ( 4 ) ,
86- borderRight : `1px solid ${ COLORS . grayMediumLight } ` ,
87- } ,
88- } ) )
89-
9050type RuntimeProps = {
9151 prominentItem ?: boolean
9252 network : Network
@@ -134,12 +94,12 @@ export const DisabledRuntimePreview: FC<DisabledRuntimePreviewProps> = ({ runtim
13494 const runtimeLabel = layerLabels [ runtime ]
13595
13696 return (
137- < StyledDisabledRuntime >
97+ < div className = "flex gap-2 pt-6 flex-row items-center md:flex-col md:items-start" >
13898 < StyledTypography > { runtimeLabel } </ StyledTypography >
139- < Box >
99+ < div >
140100 < Badge variant = "info" > { t ( 'paratimes.inactive' ) } </ Badge >
141- </ Box >
142- </ StyledDisabledRuntime >
101+ </ div >
102+ </ div >
143103 )
144104}
145105
@@ -161,8 +121,8 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
161121 const dashboardLink = RouteUtils . getDashboardRoute ( { network, layer : runtime } )
162122 const runtimeStatus = status ? ( status . outOfDate ? 'outdated' : 'stable' ) : 'inactive'
163123 return (
164- < StyledEnabledRuntime >
165- < Box sx = { { marginBottom : 4 } } >
124+ < div className = "flex-1 h-full pb-6 border-b border-gray-200 lg:p-0 lg:pr-4 lg:border-b-0 lg:border-r" >
125+ < div className = "mb-4" >
166126 < StyledTypography >
167127 { status ? (
168128 < >
@@ -175,14 +135,14 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
175135 < > { runtimeLabel } </ >
176136 ) }
177137 </ StyledTypography >
178- </ Box >
138+ </ div >
179139 < StyledList >
180140 < dt > { t ( 'common.status' ) } :</ dt >
181141 < dd >
182- < Box >
142+ < div >
183143 { runtimeStatus === 'stable' && < Badge variant = "success" > { t ( 'common.online' ) } </ Badge > }
184144 { runtimeStatus === 'outdated' && < Badge variant = "error" > { t ( 'paratimes.outdated' ) } </ Badge > }
185- </ Box >
145+ </ div >
186146 </ dd >
187147 < dt > { t ( 'paratimes.blockNumber' ) } </ dt >
188148 < dd >
@@ -201,7 +161,7 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
201161 < dt > { t ( 'paratimes.nodes' ) } </ dt >
202162 < dd > { status ?. activeNodes ? t ( 'paratimes.activeNodes' , { nodes : status ?. activeNodes } ) : '-' } </ dd >
203163 </ StyledList >
204- < Box sx = { { display : ' flex' , gap : 3 } } >
164+ < div className = " flex gap-2" >
205165 < ChartsContainer status = { status } >
206166 { panel === 'transactions' && (
207167 < TransactionsChartCard
@@ -233,9 +193,9 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
233193 />
234194 </ ChartsContainer >
235195 ) }
236- </ Box >
196+ </ div >
237197 { ! prominentItem && (
238- < Box sx = { { display : ' flex' , justifyContent : ' center' , paddingTop : 3 } } >
198+ < div className = " flex justify- center pt-2" >
239199 { status && (
240200 < >
241201 < PanelButton
@@ -252,9 +212,9 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
252212 />
253213 </ >
254214 ) }
255- </ Box >
215+ </ div >
256216 ) }
257- </ StyledEnabledRuntime >
217+ </ div >
258218 )
259219}
260220
@@ -296,16 +256,16 @@ const ChartsContainer: FC<ChartsContainerProps> = ({ children, status }) => {
296256 const { t } = useTranslation ( )
297257
298258 return (
299- < StyledBox >
300- < Box gap = { 3 } sx = { { flex : 1 , display : ' flex' , flexDirection : 'column' , alignItems : ' center' } } >
301- { status && < Box sx = { { width : '100%' } } > { children } </ Box > }
259+ < div className = "flex flex-1 items-center justify-center h-[180px] border-1 border-gray-200 rounded-md overflow-hidden" >
260+ < div className = " flex flex-1 flex-col items- center gap-2" >
261+ { status && < div className = "w-full" > { children } </ div > }
302262 { ! status && (
303263 < >
304264 < FilterNoneIcon sx = { { color : COLORS . brandDark , fontSize : '33px' } } />
305265 { t ( 'paratimes.noData' ) }
306266 </ >
307267 ) }
308- </ Box >
309- </ StyledBox >
268+ </ div >
269+ </ div >
310270 )
311271}
0 commit comments