From 36b3f211a892fc99a25b3db4eb0597594e163abf Mon Sep 17 00:00:00 2001 From: dyzhuu <119282717+dyzhuu@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:33:19 +1200 Subject: [PATCH] clean --- src/app/direct-debit/page.tsx | 6 +-- .../DebitDetailsCard/DebitDetailsCard.tsx | 42 ++++++++----------- .../DebitDetailsCardProps.tsx | 3 +- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/app/direct-debit/page.tsx b/src/app/direct-debit/page.tsx index b79ccce2..c56c21c4 100644 --- a/src/app/direct-debit/page.tsx +++ b/src/app/direct-debit/page.tsx @@ -31,8 +31,7 @@ export default function DirectDebitPage() {
{ navigator.clipboard.writeText(accountNumber); }} @@ -40,9 +39,8 @@ export default function DirectDebitPage() { { navigator.clipboard.writeText(sessionId); }} diff --git a/src/components/DebitDetailsCard/DebitDetailsCard.tsx b/src/components/DebitDetailsCard/DebitDetailsCard.tsx index c00af38e..f4ee8fd7 100644 --- a/src/components/DebitDetailsCard/DebitDetailsCard.tsx +++ b/src/components/DebitDetailsCard/DebitDetailsCard.tsx @@ -6,35 +6,29 @@ import Card from "../Card/Card"; import DebitDetailsCardProps from "./DebitDetailsCardProps"; import { MdContentCopy } from "react-icons/md"; -const DebitDetailsCard = ({title, text, sessionId, onClick, copy}: DebitDetailsCardProps) => { +const DebitDetailsCard = ({ + title, + subtitle, + sessionId, + onClick, +}: DebitDetailsCardProps) => { return ( - +

{title}

- - {text.map((text, index) => { - return ( -

- {text} -

- ); - })} +

{subtitle}

{sessionId && ( - <> -
-

SessionID:

-

{sessionId}

- - )} - - {copy && ( - +

+ SessionID: {sessionId} +

)} + {/* Clipboard button is positioned absolute relative to the parent card container */} +
); }; diff --git a/src/components/DebitDetailsCard/DebitDetailsCardProps.tsx b/src/components/DebitDetailsCard/DebitDetailsCardProps.tsx index b63cbf6d..9cfdda63 100644 --- a/src/components/DebitDetailsCard/DebitDetailsCardProps.tsx +++ b/src/components/DebitDetailsCard/DebitDetailsCardProps.tsx @@ -4,9 +4,8 @@ type DebitDetailsCardProps = { title: string; - text: string[]; + subtitle: string; sessionId?: string; - copy?: boolean; // TODO: redundant onClick?: () => void; };