From 87ee347a9e145e7a9e88be5673a19a8143009a51 Mon Sep 17 00:00:00 2001 From: isra el Date: Sun, 22 Dec 2024 02:33:47 +0300 Subject: [PATCH] ui(web): improve dashboard ui --- .../(app)/dashboard/(components)/api-keys.tsx | 28 ++++++++++++++++--- .../dashboard/(components)/device-list.tsx | 26 ++++++++++++++--- .../(app)/dashboard/(components)/overview.tsx | 3 +- .../(components)/hero-section.tsx | 4 +-- 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/web/app/(app)/dashboard/(components)/api-keys.tsx b/web/app/(app)/dashboard/(components)/api-keys.tsx index 6d3709e..c46ffc4 100644 --- a/web/app/(app)/dashboard/(components)/api-keys.tsx +++ b/web/app/(app)/dashboard/(components)/api-keys.tsx @@ -25,7 +25,7 @@ import { useToast } from '@/hooks/use-toast' import { useMutation, useQuery } from '@tanstack/react-query' import httpBrowserClient from '@/lib/httpBrowserClient' import { ApiEndpoints } from '@/config/api' -import { Spinner } from '@/components/ui/spinner' +import { Skeleton } from '@/components/ui/skeleton' export default function ApiKeys() { const { @@ -132,9 +132,29 @@ export default function ApiKeys() {
{isPending && ( -
- -
+ <> + {[1, 2, 3].map((i) => ( + + + +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ ))} + )} {error && ( diff --git a/web/app/(app)/dashboard/(components)/device-list.tsx b/web/app/(app)/dashboard/(components)/device-list.tsx index 6ed695b..23d77e2 100644 --- a/web/app/(app)/dashboard/(components)/device-list.tsx +++ b/web/app/(app)/dashboard/(components)/device-list.tsx @@ -9,7 +9,7 @@ import { useToast } from '@/hooks/use-toast' import httpBrowserClient from '@/lib/httpBrowserClient' import { ApiEndpoints } from '@/config/api' import { useQuery } from '@tanstack/react-query' -import { Spinner } from '@/components/ui/spinner' +import { Skeleton } from '@/components/ui/skeleton' export default function DeviceList() { const { toast } = useToast() @@ -42,9 +42,27 @@ export default function DeviceList() {
{isPending && ( -
- -
+ <> + {[1, 2, 3].map((i) => ( + + + +
+
+ + +
+
+ +
+
+ +
+
+
+
+ ))} + )} {error && ( diff --git a/web/app/(app)/dashboard/(components)/overview.tsx b/web/app/(app)/dashboard/(components)/overview.tsx index ac42166..7aafed3 100644 --- a/web/app/(app)/dashboard/(components)/overview.tsx +++ b/web/app/(app)/dashboard/(components)/overview.tsx @@ -6,6 +6,7 @@ import GetStartedCard from './get-started' import { ApiEndpoints } from '@/config/api' import httpBrowserClient from '@/lib/httpBrowserClient' import { useQuery } from '@tanstack/react-query' +import { Skeleton } from '@/components/ui/skeleton' // import GetStartedCard from "@/components/get-started-card"; export const StatCard = ({ title, value, icon: Icon, description }) => { @@ -16,7 +17,7 @@ export const StatCard = ({ title, value, icon: Icon, description }) => { -
{value}
+
{value ?? }

{description}

diff --git a/web/app/(landing-page)/(components)/hero-section.tsx b/web/app/(landing-page)/(components)/hero-section.tsx index 6fb7294..91ae275 100644 --- a/web/app/(landing-page)/(components)/hero-section.tsx +++ b/web/app/(landing-page)/(components)/hero-section.tsx @@ -30,11 +30,11 @@ export default function HeroSection() { Get Started - + - +