fix filter

dev
Aji Kamaludin 1 year ago
parent 9520f6e021
commit 981ca734c0
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import { Head, router } from '@inertiajs/react' import { Head, router } from '@inertiajs/react'
import { HiChevronLeft } from 'react-icons/hi2' import { HiChevronLeft, HiClipboardDocumentList } from 'react-icons/hi2'
import CustomerLayout from '@/Layouts/CustomerLayout' import CustomerLayout from '@/Layouts/CustomerLayout'
import { PayButton } from './DetailPartials/PayButton' import { PayButton } from './DetailPartials/PayButton'
@ -13,6 +13,7 @@ import {
STATUS_REJECT, STATUS_REJECT,
STATUS_EXPIRED, STATUS_EXPIRED,
} from '@/constant' } from '@/constant'
import { handleCopyToClipboard } from '../utils'
const ActionSection = ({ deposit }) => { const ActionSection = ({ deposit }) => {
if (deposit.is_valid === STATUS_EXPIRED) { if (deposit.is_valid === STATUS_EXPIRED) {
@ -67,8 +68,16 @@ export default function Detail({ deposit }) {
{/* detail */} {/* detail */}
<div className="flex flex-row items-center pb-5 border-b px-5"> <div className="flex flex-row items-center pb-5 border-b px-5">
<div className="w-full"> <div className="w-full">
<div className="font-semibold text-xl text-gray-400"> <div
{deposit.description} className="font-semibold text-xl text-gray-400 flex flex-row items-center w-full"
onClick={() =>
handleCopyToClipboard(deposit.description)
}
>
<div>{deposit.description}</div>
<div className="pl-3 text-gray-400">
<HiClipboardDocumentList />
</div>
</div> </div>
<div className="font-bold text-3xl"> <div className="font-bold text-3xl">
{deposit.amount} {deposit.amount}

@ -47,7 +47,7 @@ export const FormUploadCashDeposit = () => {
onSuccess: () => onSuccess: () =>
setTimeout( setTimeout(
() => router.get(route(route().current(), deposit)), () => router.get(route(route().current(), deposit)),
3000 500
), ),
}) })
} }

@ -47,7 +47,7 @@ export const FormUploadManual = () => {
onSuccess: () => onSuccess: () =>
setTimeout( setTimeout(
() => router.get(route(route().current(), deposit)), () => router.get(route(route().current(), deposit)),
3000 500
), ),
}) })
} }

@ -1,13 +1,14 @@
import React from 'react' import React from 'react'
import { Head, router } from '@inertiajs/react' import { Head, router } from '@inertiajs/react'
import { HiChevronLeft } from 'react-icons/hi2' import { HiChevronLeft, HiClipboardDocumentList } from 'react-icons/hi2'
import CustomerLayout from '@/Layouts/CustomerLayout' import CustomerLayout from '@/Layouts/CustomerLayout'
import { handleCopyToClipboard } from '@/Customer/utils'
export default function Detail({ poin }) { export default function Detail({ poin }) {
return ( return (
<CustomerLayout> <CustomerLayout>
<Head title="poin" /> <Head title="Poin" />
<div className="flex flex-col min-h-[calc(95dvh)]"> <div className="flex flex-col min-h-[calc(95dvh)]">
<div <div
className="w-full px-5 py-5" className="w-full px-5 py-5"
@ -19,16 +20,20 @@ export default function Detail({ poin }) {
</div> </div>
{/* detail */} {/* detail */}
<div className="flex flex-row justify-between items-center pb-5 border-b px-5"> <div className="w-full flex flex-col justify-between pb-5 border-b px-5">
<div> <div
<div className="font-semibold text-xl text-gray-400"> className="font-semibold text-xl text-gray-400 flex flex-row items-center w-full"
{poin.description} onClick={() => handleCopyToClipboard(poin.description)}
</div> >
<div className="font-bold text-3xl">{poin.amount}</div> <div>{poin.description}</div>
<div className="text-gray-400"> <div className="pl-3">
{poin.format_created_at} <HiClipboardDocumentList />
</div> </div>
</div> </div>
<div className="font-bold text-3xl">{poin.amount} poin</div>
<div className="text-gray-400">
{poin.format_created_at}
</div>
</div> </div>
<div className="w-full px-5"> <div className="w-full px-5">
<div className="my-5"> <div className="my-5">

@ -5,6 +5,7 @@ import { usePrevious } from 'react-use'
import { formatIDDate } from '@/utils' import { formatIDDate } from '@/utils'
import CustomerLayout from '@/Layouts/CustomerLayout' import CustomerLayout from '@/Layouts/CustomerLayout'
import HeaderTrx from '../Components/HeaderTrx' import HeaderTrx from '../Components/HeaderTrx'
import { isEmpty } from 'lodash'
const EmptyHere = () => { const EmptyHere = () => {
return ( return (
@ -104,7 +105,7 @@ export default function Index(props) {
</div> </div>
<div className="flex flex-col items-end"> <div className="flex flex-col items-end">
<div className="font-bold text-lg"> <div className="font-bold text-lg">
{poin.amount} {poin.amount} poin
</div> </div>
</div> </div>
</div> </div>

@ -2,8 +2,8 @@ import React from 'react'
import { Head, router } from '@inertiajs/react' import { Head, router } from '@inertiajs/react'
import CustomerLayout from '@/Layouts/CustomerLayout' import CustomerLayout from '@/Layouts/CustomerLayout'
import VoucherCard from './VoucherCard' import VoucherCard from './VoucherCard'
import { HiChevronLeft } from 'react-icons/hi2' import { HiChevronLeft, HiClipboardDocumentList } from 'react-icons/hi2'
import { convertPayedWith } from '../utils' import { convertPayedWith, handleCopyToClipboard } from '../utils'
export default function Detail({ sale }) { export default function Detail({ sale }) {
return ( return (
@ -18,8 +18,18 @@ export default function Detail({ sale }) {
> >
<HiChevronLeft className="font-bold h-5 w-5" /> <HiChevronLeft className="font-bold h-5 w-5" />
</div> </div>
<div className="text-2xl px-5 font-bold">{sale.code}</div> <div
<div className="px-5">{sale.format_created_at}</div> className=" text-2xl px-5 font-bold flex flex-row items-center w-full"
onClick={() => handleCopyToClipboard(sale.code)}
>
<div>{sale.code}</div>
<div className="pl-3 text-gray-400">
<HiClipboardDocumentList />
</div>
</div>
<div className="px-5 text-gray-400">
{sale.format_created_at}
</div>
<div className="px-5 pb-4 w-full"> <div className="px-5 pb-4 w-full">
<div className="text-xl font-bold text-right flex flex-row justify-between"> <div className="text-xl font-bold text-right flex flex-row justify-between">
<div className="flex flex-col items-start"> <div className="flex flex-col items-start">

@ -5,6 +5,7 @@ import { Head, router } from '@inertiajs/react'
import { formatIDDate } from '@/utils' import { formatIDDate } from '@/utils'
import CustomerLayout from '@/Layouts/CustomerLayout' import CustomerLayout from '@/Layouts/CustomerLayout'
import HeaderTrx from '../Components/HeaderTrx' import HeaderTrx from '../Components/HeaderTrx'
import { isEmpty } from 'lodash'
const EmptyHere = () => { const EmptyHere = () => {
return ( return (

@ -17,6 +17,11 @@ export const toastError = (message) => {
}) })
} }
export const handleCopyToClipboard = (text) => {
toastSuccess('copied to clipboard')
navigator.clipboard.writeText(text)
}
export const convertPayedWith = (payed_with) => { export const convertPayedWith = (payed_with) => {
const payedWith = [ const payedWith = [
{ {

Loading…
Cancel
Save