Skip to content

Commit

Permalink
fix: layout error when window width is small
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko233 committed Feb 29, 2024
1 parent a17510a commit 3fd4619
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/pages/connections..module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.TopPanelPaper {
@media screen and (width <= 100px) {
:global(.label) {
display: none;
}

:global(.value) {
padding-left: 8px;
}
}
}
14 changes: 11 additions & 3 deletions src/pages/connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { Virtuoso } from "react-virtuoso";
import { useRecoilState } from "recoil";
import styles from "./connections..module.scss";
import { classNames } from "@/utils";

const initConn = { uploadTotal: 0, downloadTotal: 0, connections: [] };

Expand Down Expand Up @@ -173,14 +175,20 @@ export default function ConnectionsPage() {
</Box>
}
>
<Paper sx={{ padding: 2, mb: 2 }}>
<Paper
sx={{ padding: 2, mb: 2 }}
className={classNames(styles.TopPanelPaper)}
>
<Grid container>
{connectionItems.map((item, index) => (
<Grid item xs={4} key={index}>
<Box display="flex" alignItems="center" whiteSpace="nowrap">
{item.icon}
<Typography sx={{ ml: 1, mr: 1 }}>{item.label}</Typography>
<Typography>{item.value}</Typography>
<Typography className="label" sx={{ ml: 1, mr: 1 }}>
{item.label}
</Typography>

<Typography className="value">{item.value}</Typography>
</Box>
</Grid>
))}
Expand Down

0 comments on commit 3fd4619

Please sign in to comment.