Skip to content

Commit 48388f5

Browse files
committed
Change how the server uptime is displayed on small screens
1 parent cb45a9c commit 48388f5

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/components/dashboard/InfoSection.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ export function DetailList(props: ParentProps) {
2121
interface DetailItemProps {
2222
name: string;
2323
value: string | undefined;
24+
class?: string;
2425
}
2526

2627
export function DetailItem(props: DetailItemProps) {
2728
if (!props.value) return null;
2829

2930
return (
30-
<p class="text-xs leading-6 text-gray-500 dark:text-gray-400">
31+
<p
32+
class="text-xs leading-6 text-gray-500 dark:text-gray-400"
33+
classList={{
34+
[props.class!]: !!props.class,
35+
}}
36+
>
3137
<span class="font-semibold text-gray-900 dark:text-white">
3238
{props.name}
3339
</span>

src/components/dashboard/server/ServerInfo.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export default function ServerInfo(props: Props) {
3737
>
3838
{props.varz.data?.server_name}
3939
</span>
40-
<span class="text-gray-600">/</span>
40+
<span class="text-gray-600 hidden sm:inline">/</span>
4141
<span
42-
class="font-semibold text-gray-900 dark:text-white"
42+
class="font-semibold text-gray-900 dark:text-white hidden sm:inline"
4343
title="Uptime"
4444
>
4545
{props.varz.data?.info.uptime}
@@ -48,6 +48,11 @@ export default function ServerInfo(props: Props) {
4848
</div>
4949

5050
<DetailList>
51+
<DetailItem
52+
name="Uptime"
53+
value={props.varz.data?.info.uptime}
54+
class="sm:hidden"
55+
/>
5156
<DetailItem name="Server ID" value={props.varz.data?.server_id} />
5257

5358
<Show when={props.details}>

0 commit comments

Comments
 (0)