From 0cf29e6911871b8794eb1d35884a35cd08c65a47 Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Sat, 3 Jun 2023 21:30:24 +0700 Subject: [PATCH] bit fix --- app/Http/Controllers/DepositController.php | 16 ++++++++++ config/app.php | 2 +- resources/js/Layouts/CustomerLayout.jsx | 8 +++-- resources/js/Pages/Home/Deposit/Detail.jsx | 31 ++++++++++++++----- resources/js/Pages/Home/Deposit/Topup.jsx | 4 +-- resources/js/Pages/Home/Index/Banner.jsx | 11 ++++++- resources/js/Pages/Home/Index/VoucherCard.jsx | 2 +- 7 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 app/Http/Controllers/DepositController.php diff --git a/app/Http/Controllers/DepositController.php b/app/Http/Controllers/DepositController.php new file mode 100644 index 0000000..4f1871d --- /dev/null +++ b/app/Http/Controllers/DepositController.php @@ -0,0 +1,16 @@ + 'UTC', + 'timezone' => 'Asia/Jakarta', /* |-------------------------------------------------------------------------- diff --git a/resources/js/Layouts/CustomerLayout.jsx b/resources/js/Layouts/CustomerLayout.jsx index ca0e4a4..f43840e 100644 --- a/resources/js/Layouts/CustomerLayout.jsx +++ b/resources/js/Layouts/CustomerLayout.jsx @@ -1,7 +1,8 @@ import React from 'react' -import ApplicationLogo from '@/Components/Defaults/ApplicationLogo' -import { Link, router, usePage } from '@inertiajs/react' -import { HiHome, HiOutlineHome, HiOutlineUserCircle } from 'react-icons/hi' +import { ToastContainer, toast } from 'react-toastify' + +import { router, usePage } from '@inertiajs/react' +import { HiOutlineHome, HiOutlineUserCircle } from 'react-icons/hi' import { HiArrowPathRoundedSquare, HiOutlineShoppingCart, @@ -68,6 +69,7 @@ export default function CustomerLayout({ children }) { )} + ) } diff --git a/resources/js/Pages/Home/Deposit/Detail.jsx b/resources/js/Pages/Home/Deposit/Detail.jsx index 80bf1e5..6851c58 100644 --- a/resources/js/Pages/Home/Deposit/Detail.jsx +++ b/resources/js/Pages/Home/Deposit/Detail.jsx @@ -1,12 +1,17 @@ import React, { useState, useEffect } from 'react' import { Head, router, useForm, usePage } from '@inertiajs/react' -import { HiChevronLeft } from 'react-icons/hi2' +import { + HiChevronLeft, + HiClipboard, + HiClipboardDocumentList, +} from 'react-icons/hi2' import CustomerLayout from '@/Layouts/CustomerLayout' import { formatIDR } from '@/utils' import FormFile from '@/Components/FormFile' import { isEmpty } from 'lodash' import Alert from '@/Components/Alert' +import { toast } from 'react-toastify' const PayButton = () => { const { @@ -118,6 +123,11 @@ const FormUpload = () => { setAccount(account) } + const handleCopyToClipboard = (text) => { + toast.success('copied to clipboard') + navigator.clipboard.writeText(account.account_number) + } + const handleSubmit = () => { if (processing) { return @@ -157,10 +167,9 @@ const FormUpload = () => { {data.account_id !== '' && ( <>
-
+
Silahkan transfer nominal di atas ke
- Bank :{' '} {account.bank_name} @@ -171,11 +180,19 @@ const FormUpload = () => { {account.holder_name}
-
- Nomor Rekening :{' '} - +
+ handleCopyToClipboard( + account.account_number + ) + } + > +
Nomor Rekening :
+
{account.account_number} - +
+
diff --git a/resources/js/Pages/Home/Deposit/Topup.jsx b/resources/js/Pages/Home/Deposit/Topup.jsx index 597414c..9426d04 100644 --- a/resources/js/Pages/Home/Deposit/Topup.jsx +++ b/resources/js/Pages/Home/Deposit/Topup.jsx @@ -105,10 +105,10 @@ export default function Topup({ payments }) {
-
+
Bayar
diff --git a/resources/js/Pages/Home/Index/Banner.jsx b/resources/js/Pages/Home/Index/Banner.jsx index b2aac39..fc4820e 100644 --- a/resources/js/Pages/Home/Index/Banner.jsx +++ b/resources/js/Pages/Home/Index/Banner.jsx @@ -1,12 +1,21 @@ import React from 'react' -import { Head } from '@inertiajs/react' +import { Head, router } from '@inertiajs/react' import CustomerLayout from '@/Layouts/CustomerLayout' +import { HiChevronLeft } from 'react-icons/hi2' export default function Banner({ banner }) { return (
+
{ + router.get(route('home.index')) + }} + > + +
- {voucher.location.name} + {voucher.profile}
IDR {formatIDR(voucher.price)}