fix: improve server config users tab scrolling layout
This commit is contained in:
1 parent
60ae2dde51
commit
9486f68022
1 file changed
+11
-6
@@ -15,6 +15,11 @@ export default function ServerConfigUsersPanel({
|
|||||||
snapshot,
|
snapshot,
|
||||||
snapshotLoadError,
|
snapshotLoadError,
|
||||||
}: ServerConfigUsersPanelProps) {
|
}: ServerConfigUsersPanelProps) {
|
||||||
|
const users = [
|
||||||
|
...(snapshot.rootUser ? [snapshot.rootUser] : []),
|
||||||
|
...snapshot.nonRootUsers,
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{ display: "grid", gap: 16 }}
|
style={{ display: "grid", gap: 16 }}
|
||||||
@@ -25,6 +30,7 @@ export default function ServerConfigUsersPanel({
|
|||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
gap: 12,
|
gap: 12,
|
||||||
flexWrap: "wrap",
|
flexWrap: "wrap",
|
||||||
}}
|
}}
|
||||||
@@ -44,7 +50,6 @@ export default function ServerConfigUsersPanel({
|
|||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
gap: 8,
|
gap: 8,
|
||||||
height: "10px",
|
|
||||||
flexWrap: "wrap",
|
flexWrap: "wrap",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -59,16 +64,16 @@ export default function ServerConfigUsersPanel({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{snapshot.rootUser ? <ServerUserCard user={snapshot.rootUser} /> : null}
|
{users.length > 0 ? (
|
||||||
{snapshot.nonRootUsers.length > 0 ? (
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "grid",
|
display: "grid",
|
||||||
gridTemplateColumns: "repeat(auto-fit, minmax(260px, 1fr))",
|
gridTemplateColumns:
|
||||||
|
"repeat(auto-fill, minmax(min(380px, 100%), 1fr))",
|
||||||
gap: 16,
|
gap: 16,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{snapshot.nonRootUsers.map((user) => (
|
{users.map((user) => (
|
||||||
<ServerUserCard key={user.username} user={user} />
|
<ServerUserCard key={user.username} user={user} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -79,7 +84,7 @@ export default function ServerConfigUsersPanel({
|
|||||||
>
|
>
|
||||||
{snapshotLoadError
|
{snapshotLoadError
|
||||||
? "User inventory could not be fetched because the live server snapshot is unavailable."
|
? "User inventory could not be fetched because the live server snapshot is unavailable."
|
||||||
: "No non-root users were included in the current snapshot."}
|
: "No users were included in the current snapshot."}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user