-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
7,319 additions
and
4,112 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* @author David Zhu <dzhu292@aucklanduni.ac.nz> | ||
*/ | ||
|
||
"use client"; | ||
|
||
import Heading from "@/components/Heading/Heading"; | ||
import PaymentInfoCard from "@/components/PaymentInfoCard/PaymentInfoCard"; | ||
import DebitDetailsCard from "@/components/DebitDetailsCard/DebitDetailsCard"; | ||
import Button from "@/components/Button/Button"; | ||
import ScrollShadow from "@/components/ScrollShadow"; | ||
|
||
export default function DirectDebitPage() { | ||
const firstName: string = "John"; | ||
const lastName: string = "Smith"; | ||
const sessionId: string = "rn3498"; | ||
const accountNumber: string = "xx-xxxx-xxxx-xxx"; | ||
|
||
return ( | ||
// TODO: Add functionality for DONE button | ||
// TODO: Link name, payment components to backend | ||
<div className="h-[100dvh] flex flex-col p-10"> | ||
<div className="pb-10 -translate-x-3"> | ||
<Heading>Payment</Heading> | ||
</div> | ||
<PaymentInfoCard amount={15} /> | ||
<p className="mt-auto font-medium text-center flex flex-col-reverse grow p-3"> | ||
Direct Debit | ||
</p> | ||
<ScrollShadow> | ||
<div className="flex flex-col overflow-y-auto w-full gap-4 bg-bottom h-[calc(100dvh-460px)] max-h-[248px]"> | ||
<DebitDetailsCard | ||
title="Account Number:" | ||
text={[accountNumber]} | ||
copy={true} | ||
onClick={() => { | ||
navigator.clipboard.writeText(accountNumber); | ||
}} | ||
/> | ||
|
||
<DebitDetailsCard | ||
title="Reference:" | ||
text={[firstName + " " + lastName]} | ||
sessionId={sessionId} | ||
copy={true} | ||
onClick={() => { | ||
navigator.clipboard.writeText(sessionId); | ||
}} | ||
/> | ||
</div> | ||
</ScrollShadow> | ||
|
||
<div className="flex justify-center mt-8"> | ||
<Button label="done" widthFull={true} onClick={() => alert("DONE")} /> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
scroll-shadow { | ||
display: inline-block; | ||
--scroll-shadow-size: 18; | ||
--scroll-shadow-top: linear-gradient(to top, transparent 0%, white 18px); | ||
--scroll-shadow-bottom: linear-gradient(to bottom, transparent 0%, white 18px); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* @author David Zhu <dzhu292@aucklanduni.ac.nz> | ||
*/ | ||
|
||
import Card from "../Card/Card"; | ||
import DebitDetailsCardProps from "./DebitDetailsCardProps"; | ||
import { MdContentCopy } from "react-icons/md"; | ||
|
||
const DebitDetailsCard = (props: DebitDetailsCardProps) => { | ||
return ( | ||
<Card className="bg-gray-200 p-5 mt-0 pt-50 relative"> | ||
<p className="font-medium text-xl top-5">{props.title}</p> | ||
|
||
{props.text.map((text, index) => { | ||
return ( | ||
<p className="font-normal text-gray-500" key={index}> | ||
{text} | ||
</p> | ||
); | ||
})} | ||
|
||
{props.sessionId && ( | ||
<> | ||
<br /> | ||
<p className="font-normal blueGray-200 inline">SessionID: </p> | ||
<p className="font-bold blueGray-200 inline">{props.sessionId}</p> | ||
</> | ||
)} | ||
|
||
{props.copy && ( | ||
<button | ||
onPointerDown={props.onClick} | ||
className="absolute right-4 top-1/2 translate-y-[-50%] p-2 rounded-lg" | ||
> | ||
<MdContentCopy className="text-3xl" /> | ||
</button> | ||
)} | ||
</Card> | ||
); | ||
}; | ||
|
||
export default DebitDetailsCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @author David Zhu <dzhu292@aucklanduni.ac.nz> | ||
*/ | ||
|
||
type DebitDetailsCardProps = { | ||
title: string; | ||
text: string[]; | ||
sessionId?: string; | ||
copy?: boolean; // TODO: redundant | ||
onClick?: () => void; | ||
}; | ||
|
||
export default DebitDetailsCardProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React, { useEffect } from "react"; | ||
|
||
export default function ScrollShadow({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
useEffect(() => { | ||
import("scroll-shadow-element"); | ||
}); | ||
return <scroll-shadow>{children}</scroll-shadow>; | ||
} |
Oops, something went wrong.