Skip to content
This repository was archived by the owner on Jun 29, 2025. It is now read-only.

Commit b1bfb09

Browse files
committed
fix: tables on mobile
1 parent c8a4521 commit b1bfb09

File tree

2 files changed

+60
-50
lines changed

2 files changed

+60
-50
lines changed

frontend/src/components/admin/AdminConfigTable.tsx

Lines changed: 58 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { ActionIcon, Code, Group, Skeleton, Table, Text } from "@mantine/core";
1+
import {
2+
ActionIcon,
3+
Box,
4+
Code,
5+
Group,
6+
Skeleton,
7+
Table,
8+
Text,
9+
} from "@mantine/core";
210
import { useModals } from "@mantine/modals";
311
import { useEffect, useState } from "react";
412
import { TbEdit, TbLock } from "react-icons/tb";
@@ -43,53 +51,55 @@ const AdminConfigTable = () => {
4351
));
4452

4553
return (
46-
<Table verticalSpacing="sm" horizontalSpacing="xl" withBorder>
47-
<thead>
48-
<tr>
49-
<th>Key</th>
50-
<th>Value</th>
51-
<th></th>
52-
</tr>
53-
</thead>
54-
<tbody>
55-
{isLoading
56-
? skeletonRows
57-
: configVariables.map((configVariable) => (
58-
<tr key={configVariable.key}>
59-
<td style={{ maxWidth: "200px" }}>
60-
<Code>{configVariable.key}</Code>{" "}
61-
{configVariable.secret && <TbLock />} <br />
62-
<Text size="xs" color="dimmed">
63-
{configVariable.description}
64-
</Text>
65-
</td>
66-
<td>
67-
{configVariable.obscured
68-
? "•".repeat(configVariable.value.length)
69-
: configVariable.value}
70-
</td>
71-
<td>
72-
<Group position="right">
73-
<ActionIcon
74-
color="primary"
75-
variant="light"
76-
size={25}
77-
onClick={() =>
78-
showUpdateConfigVariableModal(
79-
modals,
80-
configVariable,
81-
getConfigVariables
82-
)
83-
}
84-
>
85-
<TbEdit />
86-
</ActionIcon>
87-
</Group>
88-
</td>
89-
</tr>
90-
))}
91-
</tbody>
92-
</Table>
54+
<Box sx={{ display: "block", overflowX: "auto" }}>
55+
<Table verticalSpacing="sm" horizontalSpacing="xl" withBorder>
56+
<thead>
57+
<tr>
58+
<th>Key</th>
59+
<th>Value</th>
60+
<th></th>
61+
</tr>
62+
</thead>
63+
<tbody>
64+
{isLoading
65+
? skeletonRows
66+
: configVariables.map((configVariable) => (
67+
<tr key={configVariable.key}>
68+
<td style={{ maxWidth: "200px" }}>
69+
<Code>{configVariable.key}</Code>{" "}
70+
{configVariable.secret && <TbLock />} <br />
71+
<Text size="xs" color="dimmed">
72+
{configVariable.description}
73+
</Text>
74+
</td>
75+
<td>
76+
{configVariable.obscured
77+
? "•".repeat(configVariable.value.length)
78+
: configVariable.value}
79+
</td>
80+
<td>
81+
<Group position="right">
82+
<ActionIcon
83+
color="primary"
84+
variant="light"
85+
size={25}
86+
onClick={() =>
87+
showUpdateConfigVariableModal(
88+
modals,
89+
configVariable,
90+
getConfigVariables
91+
)
92+
}
93+
>
94+
<TbEdit />
95+
</ActionIcon>
96+
</Group>
97+
</td>
98+
</tr>
99+
))}
100+
</tbody>
101+
</Table>
102+
</Box>
93103
);
94104
};
95105

frontend/src/components/admin/ManageUserTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const ManageUserTable = ({
1818
const modals = useModals();
1919

2020
return (
21-
<Box sx={{ display: "block", overflowX: "auto", whiteSpace: "nowrap" }}>
22-
<Table verticalSpacing="sm" highlightOnHover>
21+
<Box sx={{ display: "block", overflowX: "auto" }}>
22+
<Table verticalSpacing="sm">
2323
<thead>
2424
<tr>
2525
<th>Username</th>

0 commit comments

Comments
 (0)