From 2376d57cbb58862ea32e6e3864e1073d4198624b Mon Sep 17 00:00:00 2001 From: TakahashiNguyen Date: Fri, 15 May 2026 13:22:12 +0000 Subject: [PATCH] fix: final commit (#46) Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: https://git.demonkernel.io.vn/FoodSurf/frontend/pulls/46 --- app/(main)/manager-signup/page.tsx | 26 +++++-- app/(main)/payment/page.tsx | 13 +--- .../molecules/cards/PaymentSummaryCard.tsx | 72 ++++++++++++++----- components/organisms/modals/ReviewModal.tsx | 4 +- lib/cart-context.tsx | 24 +++++++ 5 files changed, 103 insertions(+), 36 deletions(-) diff --git a/app/(main)/manager-signup/page.tsx b/app/(main)/manager-signup/page.tsx index faead35..66395b4 100644 --- a/app/(main)/manager-signup/page.tsx +++ b/app/(main)/manager-signup/page.tsx @@ -19,12 +19,14 @@ export default function ManagerSignupPage() { phone: "", password: "", eateryName: "", + bankAccount: "", // 1. Thêm bankAccount vào state }); const [errors, setErrors] = useState({ name: "", phone: "", password: "", eateryName: "", + bankAccount: "", // 2. Thêm bankAccount vào errors state submit: "", }); @@ -32,9 +34,6 @@ export default function ManagerSignupPage() { fetch("/api/manager/signup") .then((res) => { setPageState("available"); - // if (res.ok) ; - // else if (res.status === 403) setPageState("closed"); - // else setPageState("error"); }) .catch(() => setPageState("error")); }, []); @@ -54,6 +53,7 @@ export default function ManagerSignupPage() { phone: "", password: "", eateryName: "", + bankAccount: "", submit: "", }; if (!form.name.trim()) next.name = "Please enter your full name"; @@ -65,8 +65,18 @@ export default function ManagerSignupPage() { next.password = "Password must be at least 6 characters"; if (!form.eateryName.trim()) next.eateryName = "Please enter the restaurant name"; + + if (!form.bankAccount.trim()) + next.bankAccount = "Please enter your bank account number"; + setErrors(next); - return !next.name && !next.phone && !next.password && !next.eateryName; + return ( + !next.name && + !next.phone && + !next.password && + !next.eateryName && + !next.bankAccount + ); }; const handleSubmit = async (e: FormEvent) => { @@ -232,6 +242,14 @@ export default function ManagerSignupPage() { field: "eateryName" as const, type: "text", }, + { + id: "bankAccount", + label: "Bank account number (example: acb-44359797)", + icon: "fa-credit-card", + placeholder: "Enter account number (for QR payment)", + field: "bankAccount" as const, + type: "text", + }, ].map(({ id, label, icon, placeholder, field, type }) => (