From 64e7211f28763355dc3860a1a6da72f6b32d2de4 Mon Sep 17 00:00:00 2001 From: isra el Date: Sat, 20 Apr 2024 13:00:44 +0300 Subject: [PATCH] ui(web): improve dashboard ui --- web/components/dashboard/APIKeyAndDevices.tsx | 29 ++++++++++++++ web/components/dashboard/ApiKeyList.tsx | 2 +- web/components/dashboard/DeviceList.tsx | 2 +- web/components/dashboard/SendSMS.tsx | 36 +++++++++-------- web/pages/dashboard.tsx | 40 ++++--------------- 5 files changed, 58 insertions(+), 51 deletions(-) create mode 100644 web/components/dashboard/APIKeyAndDevices.tsx diff --git a/web/components/dashboard/APIKeyAndDevices.tsx b/web/components/dashboard/APIKeyAndDevices.tsx new file mode 100644 index 0000000..6f19d90 --- /dev/null +++ b/web/components/dashboard/APIKeyAndDevices.tsx @@ -0,0 +1,29 @@ +import { Box, SimpleGrid } from '@chakra-ui/react' + +import React from 'react' +import ErrorBoundary from '../ErrorBoundary' +import ApiKeyList from './ApiKeyList' +import DeviceList from './DeviceList' +import GenerateApiKey from './GenerateApiKey' + +export default function APIKeyAndDevices() { + return ( + + + + + + + + + + + + + + + + + + ) +} diff --git a/web/components/dashboard/ApiKeyList.tsx b/web/components/dashboard/ApiKeyList.tsx index af25e9c..f5669f3 100644 --- a/web/components/dashboard/ApiKeyList.tsx +++ b/web/components/dashboard/ApiKeyList.tsx @@ -57,7 +57,7 @@ const ApiKeyList = () => { return ( - +
diff --git a/web/components/dashboard/DeviceList.tsx b/web/components/dashboard/DeviceList.tsx index cabb9de..7a367b7 100644 --- a/web/components/dashboard/DeviceList.tsx +++ b/web/components/dashboard/DeviceList.tsx @@ -76,7 +76,7 @@ const DeviceList = () => { return ( -
Your API Keys
+
diff --git a/web/components/dashboard/SendSMS.tsx b/web/components/dashboard/SendSMS.tsx index a1875b4..b21d195 100644 --- a/web/components/dashboard/SendSMS.tsx +++ b/web/components/dashboard/SendSMS.tsx @@ -4,6 +4,7 @@ import { FormLabel, Input, Select, + SimpleGrid, Spinner, Textarea, useToast, @@ -113,23 +114,26 @@ export default function SendSMS() { return ( <> - - + + + - - + + + + ) } diff --git a/web/pages/dashboard.tsx b/web/pages/dashboard.tsx index 94a561a..e8b4d68 100644 --- a/web/pages/dashboard.tsx +++ b/web/pages/dashboard.tsx @@ -1,6 +1,5 @@ import { Box, - SimpleGrid, Tab, TabList, TabPanel, @@ -8,17 +7,15 @@ import { Tabs, useToast, } from '@chakra-ui/react' -import ApiKeyList from '../components/dashboard/ApiKeyList' import UserStats from '../components/dashboard/UserStats' -import GenerateApiKey from '../components/dashboard/GenerateApiKey' -import DeviceList from '../components/dashboard/DeviceList' import { useSelector } from 'react-redux' import { selectAuthUser } from '../store/authSlice' import Router from 'next/router' import { useEffect, useState } from 'react' import SendSMS from '../components/dashboard/SendSMS' -import ErrorBoundary from '../components/ErrorBoundary' import dynamic from 'next/dynamic' +import ReceiveSMS from '../components/dashboard/ReceiveSMS' +import APIKeyAndDevices from '../components/dashboard/APIKeyAndDevices' export default function Dashboard() { const NoSSRAnimatedWrapper = dynamic( @@ -52,7 +49,7 @@ export default function Dashboard() { } const DashboardTabView = () => { - const [tabIndex, setTabIndex] = useState(1) + const [tabIndex, setTabIndex] = useState(0) return ( @@ -63,41 +60,18 @@ const DashboardTabView = () => { Receive SMS - {/* - Get Started - */} + {/* Get Started */} - Receive SMS + + + ) } - -const APIKeyAndDevices = () => { - return ( - - - - - - - - - - - - {/* */} - - - - - - - ) -}
Your Devices