diff --git a/web/components/dashboard/SendSMS.tsx b/web/components/dashboard/SendSMS.tsx
index 36da667..a1875b4 100644
--- a/web/components/dashboard/SendSMS.tsx
+++ b/web/components/dashboard/SendSMS.tsx
@@ -1,20 +1,11 @@
import {
Box,
Button,
- Flex,
FormLabel,
Input,
- Modal,
- ModalBody,
- ModalCloseButton,
- ModalContent,
- ModalFooter,
- ModalHeader,
- ModalOverlay,
Select,
Spinner,
Textarea,
- useDisclosure,
useToast,
} from '@chakra-ui/react'
import { useState } from 'react'
@@ -50,22 +41,22 @@ export const SendSMSForm = ({ deviceList, formData, handleChange }) => {
- Receiver
+ Recipient
- SMS Body
+ Message
>
@@ -73,7 +64,6 @@ export const SendSMSForm = ({ deviceList, formData, handleChange }) => {
}
export default function SendSMS() {
- const { isOpen, onOpen, onClose } = useDisclosure()
const deviceList = useSelector(selectDeviceList)
const toast = useToast()
const dispatch = useAppDispatch()
@@ -82,16 +72,16 @@ export default function SendSMS() {
const [formData, setFormData] = useState({
device: '',
- receivers: '',
- smsBody: '',
+ recipients: '',
+ message: '',
})
const handSend = (e) => {
e.preventDefault()
- const { device: deviceId, receivers, smsBody } = formData
- const receiversArray = receivers.replace(' ', '').split(',')
+ const { device: deviceId, recipients, message } = formData
+ const recipientsArray = recipients.replace(' ', '').split(',')
- if (!deviceId || !receivers || !smsBody) {
+ if (!deviceId || !recipients || !message) {
toast({
title: 'Please fill all fields',
status: 'error',
@@ -99,7 +89,7 @@ export default function SendSMS() {
return
}
- for (let receiver of receiversArray) {
+ for (let recipient of recipientsArray) {
// TODO: validate phone numbers
}
@@ -107,8 +97,8 @@ export default function SendSMS() {
sendSMS({
deviceId,
payload: {
- receivers: receiversArray,
- smsBody,
+ recipients: recipientsArray,
+ message,
},
})
)
@@ -123,39 +113,23 @@ export default function SendSMS() {
return (
<>
-
-
-
+
+
-
-
-
- Send SMS
-
-
-
-
-
-
-
-
-
-
+
+
>
)
}
diff --git a/web/components/dashboard/UserStats.tsx b/web/components/dashboard/UserStats.tsx
index 08ef988..529514e 100644
--- a/web/components/dashboard/UserStats.tsx
+++ b/web/components/dashboard/UserStats.tsx
@@ -28,8 +28,8 @@ const UserStats = () => {
diff --git a/web/components/dashboard/UserStatsCard.tsx b/web/components/dashboard/UserStatsCard.tsx
index c9acbc2..174fc70 100644
--- a/web/components/dashboard/UserStatsCard.tsx
+++ b/web/components/dashboard/UserStatsCard.tsx
@@ -10,20 +10,21 @@ export default function UserStatsCard({ ...props }) {
const { title, stat } = props
return (
{title}
-
+
{stat}
diff --git a/web/pages/dashboard.tsx b/web/pages/dashboard.tsx
index da51aca..94a561a 100644
--- a/web/pages/dashboard.tsx
+++ b/web/pages/dashboard.tsx
@@ -1,4 +1,13 @@
-import { Box, SimpleGrid, useToast } from '@chakra-ui/react'
+import {
+ Box,
+ SimpleGrid,
+ Tab,
+ TabList,
+ TabPanel,
+ TabPanels,
+ Tabs,
+ useToast,
+} from '@chakra-ui/react'
import ApiKeyList from '../components/dashboard/ApiKeyList'
import UserStats from '../components/dashboard/UserStats'
import GenerateApiKey from '../components/dashboard/GenerateApiKey'
@@ -6,7 +15,7 @@ import DeviceList from '../components/dashboard/DeviceList'
import { useSelector } from 'react-redux'
import { selectAuthUser } from '../store/authSlice'
import Router from 'next/router'
-import { useEffect } from 'react'
+import { useEffect, useState } from 'react'
import SendSMS from '../components/dashboard/SendSMS'
import ErrorBoundary from '../components/ErrorBoundary'
import dynamic from 'next/dynamic'
@@ -31,25 +40,64 @@ export default function Dashboard() {
Router.push('/login')
}
}, [authUser, toast])
+
+ return (
+ <>
+
+
+
+
+ >
+ )
+}
+
+const DashboardTabView = () => {
+ const [tabIndex, setTabIndex] = useState(1)
return (
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {/* Get Started */}
+ API Key and Devices
+ Send SMS
+ Receive SMS
+
+
+ {/*
+ Get Started
+ */}
+
+
+
+
-
-
-
-
-
+
+ Receive SMS
+
+
+
+ )
+}
+
+const APIKeyAndDevices = () => {
+ return (
+
+
+
-
+
+
+
+
+
+
+
+ {/* */}
+
+
+
+
+
+
)
}
diff --git a/web/services/types.ts b/web/services/types.ts
index a1d9d1a..36d8faf 100644
--- a/web/services/types.ts
+++ b/web/services/types.ts
@@ -50,8 +50,8 @@ export interface CurrentUserResponse extends BaseResponse {
}
export interface SendSMSRequestPayload {
- receivers: string[]
- smsBody: string
+ recipients: string[]
+ message: string
}
export interface ApiKeyEntity {