From 70a2ac354e8a78318cf3ae435b41b0cb70ca2af1 Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Sun, 22 Aug 2021 18:11:18 +0700 Subject: [PATCH] typo fixing feedback --- src/layouts/Dashboard.js | 40 +++++++++++++++++++++++--------- src/views/dashboard/Dashboard.js | 2 +- src/views/purchases/Create.js | 8 +++++++ src/views/sales/Create.js | 26 ++++++++++++++++++++- 4 files changed, 63 insertions(+), 13 deletions(-) diff --git a/src/layouts/Dashboard.js b/src/layouts/Dashboard.js index 6cbbe51..0d2bb4c 100644 --- a/src/layouts/Dashboard.js +++ b/src/layouts/Dashboard.js @@ -4,7 +4,8 @@ import { Container, Flex, Box, - useBreakpointValue + useBreakpointValue, + Link } from "@chakra-ui/react"; import Sidebar from "../components/Layout/Sidebar" @@ -47,7 +48,11 @@ export default function DashboardLayout(props) { return ( - +
- + {/* Content */} - }> + }> {routes.map((route, index) => { return route.component ? ( - } + render={(props) => } key={index} /> - ) : null + ) : null; })} - + - - © {(new Date()).getFullYear()} kasirAja dev + + + © {new Date().getFullYear()} kasirAja dev + - ) + ); } \ No newline at end of file diff --git a/src/views/dashboard/Dashboard.js b/src/views/dashboard/Dashboard.js index 29176bb..f847e94 100644 --- a/src/views/dashboard/Dashboard.js +++ b/src/views/dashboard/Dashboard.js @@ -109,7 +109,7 @@ export default function Dashboard(props) { - labar kotor + laba kotor {formatIDR(grossProfit)} diff --git a/src/views/purchases/Create.js b/src/views/purchases/Create.js index 0dc52d5..6aba688 100644 --- a/src/views/purchases/Create.js +++ b/src/views/purchases/Create.js @@ -109,6 +109,14 @@ export default function Create() { const handleCreatePurchase = () => { if(items.length <= 0) { + toast({ + title: 'error', + description: 'item produk kosong', + status: 'warning', + isClosable: true, + duration: 6000, + position: 'top-right', + }); return } setSummit(true) diff --git a/src/views/sales/Create.js b/src/views/sales/Create.js index cbb5962..d30af80 100644 --- a/src/views/sales/Create.js +++ b/src/views/sales/Create.js @@ -123,9 +123,25 @@ export default function Create() { const handlePay = () => { if(customer.name === "") { - return + toast({ + title: 'error', + description: 'pelanggan kosong', + status: 'warning', + isClosable: true, + duration: 6000, + position: 'top-right', + }); + return } if(items.length <= 0) { + toast({ + title: 'error', + description: 'item produk kosong', + status: 'warning', + isClosable: true, + duration: 6000, + position: 'top-right', + }); return } if(payAmount === "" || +payAmount <= 0) { @@ -166,6 +182,14 @@ export default function Create() { }) }, user.accessToken) .then((res) => { + toast({ + title: 'success', + description: res.message, + status: 'success', + isClosable: true, + duration: 2000, + position: 'top-right', + }); toggleChange() }) .catch(err => {