diff --git a/client/src/App.tsx b/client/src/App.tsx index 6f1fa97..a52747e 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -34,6 +34,7 @@ import ManageVoucherPage from "./pages/ManageVoucherPage"; import CreateVoucherPage from "./pages/CreateVoucherPage"; import EditVoucherPage from "./pages/EditVoucherPage"; import FeedbackPage from "./pages/FeedbackPage"; +import UserVouchersPage from "./pages/UserVouchersPage"; import ManageFeedbacksPage from "./pages/ManageFeedbacksPage"; import TagManagement from "./pages/TagManagement"; @@ -79,6 +80,8 @@ function App() { + } path="user-voucher" /> + {/* Special (Restricted) Routes */} }> } path="forgot-password" /> diff --git a/client/src/components/NavigationBar.tsx b/client/src/components/NavigationBar.tsx index 0330764..902cdf4 100644 --- a/client/src/components/NavigationBar.tsx +++ b/client/src/components/NavigationBar.tsx @@ -12,6 +12,7 @@ import { ArrowRightStartOnRectangleIcon, PencilSquareIcon, RocketLaunchIcon, + VoucherIcon, } from "../icons"; import config from "../config"; @@ -155,6 +156,14 @@ export default function NavigationBar() { navigate("/manage-account"); }} /> + } + onPress={() => { + navigate("/user-voucher"); + }} + /> { ); }; +export const VoucherIcon = () => { + return ( + + + + ); +}; + export const CheckmarkIcon = () => { return ( 0 ? filteredData[0] : null; - const top5Users = filteredData.slice(1, 10); + const top10Users = filteredData.slice(1, 10); return (
@@ -180,7 +180,7 @@ export default function HBContestPage() { )}
- {top5Users.map((user, index) => ( + {top10Users.map((user, index) => (
{index + 2} {user.name} diff --git a/client/src/pages/ManageVoucherPage.tsx b/client/src/pages/ManageVoucherPage.tsx index 21a962d..cb25bc0 100644 --- a/client/src/pages/ManageVoucherPage.tsx +++ b/client/src/pages/ManageVoucherPage.tsx @@ -104,17 +104,26 @@ export default function ManageVoucherPage() {
+ Brand Logo Brand Description Expiration Date Quantity Available Code - Brand Logo Actions {voucherList.map((voucher) => ( + + {brandLogoUrls[voucher.id] && ( + {voucher.brand} + )} + {voucher.brand} {voucher.description} @@ -122,15 +131,6 @@ export default function ManageVoucherPage() { {voucher.quantityAvailable} {voucher.code} - - {brandLogoUrls[voucher.id] && ( - {voucher.brand} - )} - + )} +
+ {townCouncils.length > 0 && ( + + )}
- User ID User Name User Email Electrical Bill @@ -155,7 +283,6 @@ export default function Ranking() { {combinedData.map((data) => ( - {data.userId} {data.userName} {data.userEmail} ${data.electricalBill.toFixed(2)} @@ -182,13 +309,13 @@ export default function Ranking() { <> Send Email -

Are you sure you want to send this email to {selectedUser.email}?

+

Are you sure you want to send an email to {selectedUser.name} ({selectedUser.email})?

- @@ -203,11 +330,11 @@ export default function Ranking() { <> Delete Entry -

Are you sure you want to delete this entry?

+

Are you sure you want to delete this form entry?