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'
6- import Link from '@mui/material/Link '
7- import Typography from '@mui/material/Typography '
5+ import { Link } from '@oasisprotocol/ui-library/src/components/link '
6+ import { Typography } from '@oasisprotocol/ui-library/src/components/typography '
87import { styled } from '@mui/material/styles'
98import FilterNoneIcon from '@mui/icons-material/FilterNone'
109import RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked'
@@ -38,55 +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-
53- const StyledTypography = styled ( Typography ) ( ( ) => ( {
54- fontSize : '18px' ,
55- fontWeight : 700 ,
56- color : COLORS . brandDark ,
57- flex : 1 ,
58- minHeight : '44px' ,
59- display : 'flex' ,
60- alignItems : 'center' ,
61- } ) )
62-
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-
9040type RuntimeProps = {
9141 prominentItem ?: boolean
9242 network : Network
@@ -134,12 +84,14 @@ export const DisabledRuntimePreview: FC<DisabledRuntimePreviewProps> = ({ runtim
13484 const runtimeLabel = layerLabels [ runtime ]
13585
13686 return (
137- < StyledDisabledRuntime >
138- < StyledTypography > { runtimeLabel } </ StyledTypography >
139- < Box >
87+ < div className = "flex gap-2 flex-row items-center pt-2 lg:pt-0" >
88+ < Typography className = "text-base font-semibold text-primary flex items-center flex-1 min-h-[44px]" >
89+ { runtimeLabel }
90+ </ Typography >
91+ < div >
14092 < Badge variant = "info" > { t ( 'paratimes.inactive' ) } </ Badge >
141- </ Box >
142- </ StyledDisabledRuntime >
93+ </ div >
94+ </ div >
14395 )
14496}
14597
@@ -161,28 +113,28 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
161113 const dashboardLink = RouteUtils . getDashboardRoute ( { network, layer : runtime } )
162114 const runtimeStatus = status ? ( status . outOfDate ? 'outdated' : 'stable' ) : 'inactive'
163115 return (
164- < StyledEnabledRuntime >
165- < Box sx = { { marginBottom : 4 } } >
166- < StyledTypography >
116+ < 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" >
117+ < div className = "mb-4" >
118+ < Typography className = "text-base font-semibold text-primary flex items-center flex-1 min-h-[44px]" >
167119 { status ? (
168120 < >
169- < Link component = { RouterLink } to = { dashboardLink } >
170- { runtimeLabel }
121+ < Link asChild >
122+ < RouterLink to = { dashboardLink } > { runtimeLabel } </ RouterLink >
171123 </ Link >
172124 < RouterLinkCircle to = { dashboardLink } />
173125 </ >
174126 ) : (
175127 < > { runtimeLabel } </ >
176128 ) }
177- </ StyledTypography >
178- </ Box >
129+ </ Typography >
130+ </ div >
179131 < StyledList >
180132 < dt > { t ( 'common.status' ) } :</ dt >
181133 < dd >
182- < Box >
134+ < div >
183135 { runtimeStatus === 'stable' && < Badge variant = "success" > { t ( 'common.online' ) } </ Badge > }
184136 { runtimeStatus === 'outdated' && < Badge variant = "error" > { t ( 'paratimes.outdated' ) } </ Badge > }
185- </ Box >
137+ </ div >
186138 </ dd >
187139 < dt > { t ( 'paratimes.blockNumber' ) } </ dt >
188140 < dd >
@@ -201,7 +153,7 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
201153 < dt > { t ( 'paratimes.nodes' ) } </ dt >
202154 < dd > { status ?. activeNodes ? t ( 'paratimes.activeNodes' , { nodes : status ?. activeNodes } ) : '-' } </ dd >
203155 </ StyledList >
204- < Box sx = { { display : ' flex' , gap : 3 } } >
156+ < div className = " flex gap-2" >
205157 < ChartsContainer status = { status } >
206158 { panel === 'transactions' && (
207159 < TransactionsChartCard
@@ -210,6 +162,7 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
210162 network,
211163 } }
212164 chartDuration = { ChartDuration . TODAY }
165+ noBorder
213166 />
214167 ) }
215168 { panel === 'accounts' && (
@@ -219,6 +172,7 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
219172 network,
220173 } }
221174 chartDuration = { ChartDuration . TODAY }
175+ noBorder
222176 />
223177 ) }
224178 </ ChartsContainer >
@@ -230,12 +184,13 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
230184 network,
231185 } }
232186 chartDuration = { ChartDuration . TODAY }
187+ noBorder
233188 />
234189 </ ChartsContainer >
235190 ) }
236- </ Box >
191+ </ div >
237192 { ! prominentItem && (
238- < Box sx = { { display : ' flex' , justifyContent : ' center' , paddingTop : 3 } } >
193+ < div className = " flex justify- center pt-2" >
239194 { status && (
240195 < >
241196 < PanelButton
@@ -252,9 +207,9 @@ const RuntimePreview: FC<RuntimePreviewProps> = ({ prominentItem, network, runti
252207 />
253208 </ >
254209 ) }
255- </ Box >
210+ </ div >
256211 ) }
257- </ StyledEnabledRuntime >
212+ </ div >
258213 )
259214}
260215
@@ -296,16 +251,16 @@ const ChartsContainer: FC<ChartsContainerProps> = ({ children, status }) => {
296251 const { t } = useTranslation ( )
297252
298253 return (
299- < StyledBox >
300- < Box gap = { 3 } sx = { { flex : 1 , display : ' flex' , flexDirection : 'column' , alignItems : ' center' } } >
301- { status && < Box sx = { { width : '100%' } } > { children } </ Box > }
254+ < div className = "flex flex-1 items-center justify-center h-[180px] border-1 border-gray-200 rounded-md overflow-hidden" >
255+ < div className = " flex flex-1 flex-col items- center gap-2" >
256+ { status && < div className = "w-full" > { children } </ div > }
302257 { ! status && (
303258 < >
304259 < FilterNoneIcon sx = { { color : COLORS . brandDark , fontSize : '33px' } } />
305260 { t ( 'paratimes.noData' ) }
306261 </ >
307262 ) }
308- </ Box >
309- </ StyledBox >
263+ </ div >
264+ </ div >
310265 )
311266}
0 commit comments