From e5b1f4f700ab8636a4c4583793d281d54959f4fe Mon Sep 17 00:00:00 2001 From: Peter NDENGO Date: Wed, 31 Jan 2024 17:14:17 +0100 Subject: [PATCH] Grayed when voucher've been already used --- .env | 2 +- next.config.js | 4 +- pages/voucher/pass/[pass].js | 286 ++++++++++++++++++++++++----------- 3 files changed, 198 insertions(+), 94 deletions(-) diff --git a/.env b/.env index 4b601bd..191397f 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ NEXT_PUBLIC_API_URL="https://api.wiiqare.com" CALLBACK_URL="https://app.wiiqare.com" -NEXTAUTH_URL=https://app.wiiqare.com +NEXTAUTH_URL=http://localhost:3000 NEXT_PUBLIC_GOOGLE_CLIENT_ID=89089276805-85nh0ek1kac55o2t5lo0gn0jr77cppsb.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=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 diff --git a/next.config.js b/next.config.js index 332b447..001425c 100644 --- a/next.config.js +++ b/next.config.js @@ -17,8 +17,8 @@ const nextConfig = withPWA({ env: { NEXT_PUBLIC_API_URL: 'https://api.wiiqare.com', //NEXT_PUBLIC_API_URL: 'http://localhost:3001', - //NEXT_PUBLIC_BASE_URL: 'http://localhost:3000', - NEXT_PUBLIC_BASE_URL: 'https://app.wiiqare.com', + NEXT_PUBLIC_BASE_URL: 'http://localhost:3000', + //NEXT_PUBLIC_BASE_URL: 'https://app.wiiqare.com', NEXTAUTH_URL: 'https://app.wiiqare.com', }, }); diff --git a/pages/voucher/pass/[pass].js b/pages/voucher/pass/[pass].js index 1640ae6..4f7561b 100644 --- a/pages/voucher/pass/[pass].js +++ b/pages/voucher/pass/[pass].js @@ -22,6 +22,8 @@ function Pass() { `/payment/voucher?paymentId=${pass}`, ); + console.log(data); + if (isLoading) return ( <> @@ -70,107 +72,209 @@ function Pass() { return (
<> -
-
- Logo -

- Pass Santé -

-
- - Pass Santé ID: - { - setCopy(true); - setTimeout(() => { - setCopy(false); - }, 2000); - }} - > -
- [ -
- - - + { + data.status === "PAID_OUT" ? ( + <> +
+
+ Logo +

+ Pass Santé +

- ] + + Pass Santé ID: + +
+ [ +
+ + + +
+ ] +
+
- - -
-
-
- - {/*
+
+
+ + {/*
*/} -
+
-
-
- Image Description - Image Description -
- -

- - - {' '} - {new Intl.NumberFormat('en-US', { - style: 'currency', - currency: data.currency, - }).format(data.amount)} +
+
+ Image Description + Image Description +
+ +

+ + + {' '} + {new Intl.NumberFormat('en-US', { + style: 'currency', + currency: data.currency, + }).format(data.amount)} + + Pass santé WiiQare + + de{' '} + + {data?.sender?.firstName || "WiiQare Admin"} + {' '} + à{' '} + + {data?.patient?.firstName} + +

+
+

+ + ) : ( + <> +
+
+ Logo +

+ Pass Santé +

+
+ + Pass Santé ID: + { + setCopy(true); + setTimeout(() => { + setCopy(false); + }, 2000); + }} + > +
+ [ +
+ + + +
+ ] +
+
- Pass santé WiiQare - - de{' '} - - {data?.sender?.firstName || "WiiQare Admin"} - {' '} - à{' '} - - {data.patient.firstName} - - -
-
+
+ +
+
+ + {/*
+ +
*/} +
+ +
+
+ Image Description + Image Description +
+ +

+ + + {' '} + {new Intl.NumberFormat('en-US', { + style: 'currency', + currency: data.currency, + }).format(data.amount)} + + Pass santé WiiQare + + de{' '} + + {data?.sender?.firstName || "WiiQare Admin"} + {' '} + à{' '} + + {data?.patient?.firstName} + +

+
+
+ + ) + } +