@@ -28,10 +28,13 @@ import { useDUStatusPageFetchByUrl } from "./Hooks/useDUStatusPageFetchByUrl";
28
28
import { useStatusPageDelete } from "../../StatusPage/Status/Hooks/useStatusPageDelete" ;
29
29
import TimeFrameHeader from "./Components/TimeframeHeader" ;
30
30
import SubHeader from "../../../Components/Subheader" ;
31
-
31
+ import { safelyParseFloat } from "../../../Utils/utils" ;
32
32
import { useNavigate , useLocation } from "react-router-dom" ;
33
33
import { useTranslation } from "react-i18next" ;
34
34
35
+ // Responsive
36
+ import { useMediaQuery } from "@mui/material" ;
37
+
35
38
const DistributedUptimeStatus = ( ) => {
36
39
const { url } = useParams ( ) ;
37
40
const location = useLocation ( ) ;
@@ -45,6 +48,7 @@ const DistributedUptimeStatus = () => {
45
48
const [ timeFrame , setTimeFrame ] = useState ( 30 ) ;
46
49
// Utils
47
50
const theme = useTheme ( ) ;
51
+ const isSmallScreen = useMediaQuery ( theme . breakpoints . down ( "sm" ) ) ;
48
52
const navigate = useNavigate ( ) ;
49
53
50
54
const [
@@ -170,8 +174,11 @@ const DistributedUptimeStatus = () => {
170
174
/>
171
175
172
176
< SubHeader
177
+ direction = { { s : "column" , md : "row" } }
173
178
headerText = { t ( "distributedStatusHeaderText" ) }
174
179
subHeaderText = { t ( "distributedStatusSubHeaderText" ) }
180
+ gap = { isSmallScreen ? theme . spacing ( 10 ) : 0 }
181
+ alignItems = { { s : "flex-start" , md : "flex-end" } }
175
182
>
176
183
< RowContainer >
177
184
< Stack >
@@ -195,16 +202,15 @@ const DistributedUptimeStatus = () => {
195
202
setDateRange = { setDateRange }
196
203
/>
197
204
< Stack
198
- direction = "row"
199
205
gap = { theme . spacing ( 8 ) }
206
+ direction = { { s : "column" , md : "row" } }
200
207
>
201
208
< DistributedUptimeMap
202
209
checks = { monitor ?. groupedMapChecks ?? [ ] }
203
- height = { "100%" }
204
- width = { "50%" }
210
+ width = { isSmallScreen ? "100%" : "50%" }
205
211
/>
206
212
< Stack
207
- width = { " 50%"}
213
+ width = { { s : "100%" , md : " 50%" } }
208
214
gap = { theme . spacing ( 8 ) }
209
215
>
210
216
< Stack
@@ -219,8 +225,8 @@ const DistributedUptimeStatus = () => {
219
225
sx = { { width : "50%" } }
220
226
/>
221
227
< InfoBox
222
- heading = "UPT Burned"
223
- subHeading = { monitor ?. totalUptBurnt ?? 0 }
228
+ heading = { isSmallScreen ? "UPT" : "UPT Burned"}
229
+ subHeading = { safelyParseFloat ( monitor ?. totalUptBurnt ) . toFixed ( 4 ) }
224
230
img = { UptLogo }
225
231
alt = "Upt Logo"
226
232
sx = { { width : "50%" } }
@@ -240,13 +246,16 @@ const DistributedUptimeStatus = () => {
240
246
/>
241
247
242
248
< SubHeader
249
+ direction = { { s : "column" , md : "row" } }
243
250
headerText = { t ( "distributedStatusServerMonitors" ) }
244
251
subHeaderText = { t ( "distributedStatusServerMonitorsDescription" ) }
245
- alignItems = "end"
252
+ gap = { isSmallScreen ? theme . spacing ( 10 ) : 0 }
253
+ alignItems = { { s : "flex-start" , md : "flex-end" } }
246
254
>
247
255
< TimeFrameHeader
248
256
timeFrame = { timeFrame }
249
257
setTimeFrame = { setTimeFrame }
258
+ alignSelf = "flex-start"
250
259
/>
251
260
</ SubHeader >
252
261
0 commit comments