From 93a3199f33389daa226ba5b963dda1967397a9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leandro=20Ant=C3=B4nio=20Farias=20Machado?= Date: Mon, 3 Apr 2023 07:11:52 -0300 Subject: [PATCH] feat(frontend): devices page in progress --- frontend/src/pages/devices.js | 4 ++-- frontend/src/pages/devices/[id].js | 11 +++++++++++ .../src/sections/overview/overview-latest-orders.js | 9 ++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 frontend/src/pages/devices/[id].js diff --git a/frontend/src/pages/devices.js b/frontend/src/pages/devices.js index dc241ad..67096c2 100644 --- a/frontend/src/pages/devices.js +++ b/frontend/src/pages/devices.js @@ -43,7 +43,7 @@ const Page = () => ( name: 'Ekaterina Tankova' }, createdAt: 1555016400000, - status: 'Associando' + status: 'Associating' }, { id: '9eaa1c7dd4433f413c308ce2', @@ -73,7 +73,7 @@ const Page = () => ( name: 'Anje Keizer' }, createdAt: 1554757200000, - status: 'Associando' + status: 'Associating' }, { id: '9f974f239d29ede969367103', diff --git a/frontend/src/pages/devices/[id].js b/frontend/src/pages/devices/[id].js new file mode 100644 index 0000000..1e182e0 --- /dev/null +++ b/frontend/src/pages/devices/[id].js @@ -0,0 +1,11 @@ +import { useRouter } from 'next/router' + +const Page = () => { + const router = useRouter() + const { id } = router.query + + return

Device: {id}

+} + + +export default Page; diff --git a/frontend/src/sections/overview/overview-latest-orders.js b/frontend/src/sections/overview/overview-latest-orders.js index 2838f85..3251c95 100644 --- a/frontend/src/sections/overview/overview-latest-orders.js +++ b/frontend/src/sections/overview/overview-latest-orders.js @@ -18,9 +18,10 @@ import { } from '@mui/material'; import { Scrollbar } from 'src/components/scrollbar'; import { SeverityPill } from 'src/components/severity-pill'; +import { useRouter } from 'next/router'; const statusMap = { - Associando: 'warning', + Associating: 'warning', Online: 'success', Offline: 'error' }; @@ -28,6 +29,8 @@ const statusMap = { export const OverviewLatestOrders = (props) => { const { orders = [], sx } = props; + const router = useRouter() + return ( @@ -49,7 +52,7 @@ export const OverviewLatestOrders = (props) => { Status - Acessar + Access @@ -77,7 +80,7 @@ export const OverviewLatestOrders = (props) => { - + router.push("devices/"+order.id)}>