diff --git a/src/app/customer/page.tsx b/src/app/customer/page.tsx index 3ddbaa7..1c76416 100644 --- a/src/app/customer/page.tsx +++ b/src/app/customer/page.tsx @@ -22,67 +22,74 @@ export default function CustomerPage() { }, [selectedStore]); return ( -
-
- -
+
+
+
+ +
-

Customer Page

-

Select a store

+

Customer Page

+

Select a store

- - {selectedStore !== null && ( - { - setSelectedReservationId(reservationId); - }} + - )} - {selectedStore !== null && selectedReservationId !== null && ( - { - // TODO: replace with actual reservation ID - const tx = bookReservation(selectedReservationId); - return tx; - }} - onTransactionSent={(result) => { - console.log("Transaction submitted", result.transactionHash); - }} - onTransactionConfirmed={(receipt) => { - console.log("Transaction confirmed", receipt.transactionHash); - window.location.reload(); - }} - onError={(error) => { - console.error("Transaction error", error); - }} - > - Make a Reservatinon - - )} -
- - - +

Select a Time Slot

+ { + setSelectedReservationId(reservationId); + }} /> - - To Store Page - +
+ )} + {selectedStore !== null && selectedReservationId !== null && ( +
+ { + // TODO: replace with actual reservation ID + const tx = bookReservation(selectedReservationId); + return tx; + }} + onTransactionSent={(result) => { + console.log("Transaction submitted", result.transactionHash); + }} + onTransactionConfirmed={(receipt) => { + console.log("Transaction confirmed", receipt.transactionHash); + window.location.reload(); + }} + onError={(error) => { + console.error("Transaction error", error); + }} + > + Make a Reservatinon + +
+ )} +
+ + + + + To Store Page + +
); -} +} \ No newline at end of file diff --git a/src/app/store/page.tsx b/src/app/store/page.tsx index 34f98eb..7c033ab 100644 --- a/src/app/store/page.tsx +++ b/src/app/store/page.tsx @@ -34,96 +34,98 @@ export default function StorePage() { }; return ( -
-
- -
+
+
+
+ +
-

Store Page

+

Store Management Page

-
-

- Store of choice -

- {selectedStore ? ( - <> -

- Store Name: {selectedStore.storeName} -

-

- Store ID: {selectedStore.storeId.toString()} -

- - ) : ( -

Store is not selected.

- )} -
+
+

+ Selected Store +

+ {selectedStore ? ( + <> +

+ Store Name: {selectedStore.storeName} +

+

+ Store ID: {selectedStore.storeId.toString()} +

+ + ) : ( +

No store selected.

+ )} +
-
-
- - - - +
+
+ + + + +
-
-
{renderTabContent()}
+
{renderTabContent()}
-
- - + - - - To Customer Page - + + + + To Customer Page + +
); -} +} \ No newline at end of file diff --git a/src/components/StoreSelector.tsx b/src/components/StoreSelector.tsx index 5cb3a5f..73881e9 100644 --- a/src/components/StoreSelector.tsx +++ b/src/components/StoreSelector.tsx @@ -3,7 +3,7 @@ import Image from "next/image"; import { Store } from "@/utils/type"; import { useActiveAccount } from "thirdweb/react"; import { listReservations, listStores } from "@/utils/store/management"; -import { getContract, readContract } from "thirdweb"; +import { ZERO_ADDRESS, getContract, readContract } from "thirdweb"; import { chain, client, erc20Abi, loyaltyLogicContractAbi } from "@/app/client"; export default function StoreSelector({ @@ -29,7 +29,7 @@ export default function StoreSelector({ store.maxFee = fees.length ? Math.max(...fees) : 0; store.minFee = fees.length ? Math.min(...fees) : 0; - if (store.loyaltyLogicContractAddress !== "0x0000000000000000000000000000000000000000") { + if (store.loyaltyLogicContractAddress !== ZERO_ADDRESS) { // TODO: Do this in listStores // get loyalty logic contract address const loyaltyLogicContract = getContract({