From 068ee294dd9e513d415c0aa4e49ab906bb0a3785 Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:34:33 -0700 Subject: [PATCH 01/12] trying conditional nav --- src/app/checkout/page.tsx | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index 3b66b7ef..81d752a6 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -1,7 +1,34 @@ +'use client'; + +import { useRouter } from "next/navigation"; +import supabase from "@/api/supabase/createClient"; +import { Button } from "../login/styles"; + +const { data: { user } } = await supabase.auth.getUser(); +console.log(user); +const userDelivery = user; +const { data, error } = await supabase + .from('profiles') + .select('delivery_enabled') + .eq('user_id', user?.id) + export default function Checkout() { + const router = useRouter(); + + const checkDelivery = () => { + if (userDelivery) { + router.push('/delivery'); + } else { + router.push('/pickup'); + } + }; + return (
-
Checkout
+ + {/*
Checkout
*/}
); } From eb8cf94438924de30db03f166d973aa29d7abf5f Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:43:33 -0700 Subject: [PATCH 02/12] schema changes --- src/app/checkout/page.tsx | 5 ++++- src/schema/schema.ts | 12 +++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index 81d752a6..3f10f073 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -3,8 +3,11 @@ import { useRouter } from "next/navigation"; import supabase from "@/api/supabase/createClient"; import { Button } from "../login/styles"; +import { User } from "@/schema/schema"; -const { data: { user } } = await supabase.auth.getUser(); +const { data: { user } } = async (): Promise => { + await supabase.auth.getUser() +}; console.log(user); const userDelivery = user; const { data, error } = await supabase diff --git a/src/schema/schema.ts b/src/schema/schema.ts index ff8d3d18..3b994e80 100644 --- a/src/schema/schema.ts +++ b/src/schema/schema.ts @@ -1,21 +1,19 @@ export type User = { + user_id: string; // UUID email: string; password: string; first_name: string; last_name: string; pet_information: string; - user_id: string; // UUID - order_option: boolean; - address: number; // index of the address the street, city, and zipcode to build the address - street: string[]; - city: string[]; - zipcode: string[]; + delivery_allowed: boolean; + created_at: Date; // index of the address the street, city, and zipcode to build the address + cart_id: string; // UUID + address_id: string; // UUID }; export type Order = { id: number; // bigint generated by default as identity user_id: string; // UUID not null - cart: number; // bigint[] null status: string; // bigint null pickup_time: number; // bigint null }; From 7af1ab5fdd196ff56c481aa217877a44f22bb3c7 Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Sat, 21 Oct 2023 17:10:34 -0700 Subject: [PATCH 03/12] checkout page working --- src/api/supabase/auth/auth.tsx | 2 + src/api/supabase/queries/user_queries.ts | 17 ++++++-- src/app/checkout/page.tsx | 49 +++++++++++++++--------- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/api/supabase/auth/auth.tsx b/src/api/supabase/auth/auth.tsx index 8e71dead..ea108d9e 100644 --- a/src/api/supabase/auth/auth.tsx +++ b/src/api/supabase/auth/auth.tsx @@ -12,6 +12,8 @@ export const handleSignUp = async (email: string, password: string) => { export const signInWithEmail = async (email: string, password: string) => { console.log('hi'); + console.log(email) + console.log(password) const { data, error } = await supabase.auth.signInWithPassword({ email, password, diff --git a/src/api/supabase/queries/user_queries.ts b/src/api/supabase/queries/user_queries.ts index d4030a4d..e9c5c9f3 100644 --- a/src/api/supabase/queries/user_queries.ts +++ b/src/api/supabase/queries/user_queries.ts @@ -21,7 +21,7 @@ export async function fetchUserData(): Promise< > { try { const { data: users, error } = await supabase - .from('Users') + .from('profiles') .select('*') .single(); @@ -36,12 +36,21 @@ export async function fetchUserData(): Promise< } } +// export async function fetchUserDelivery( +// uuid: string +// ) { +// const { error } = await supabase +// .from('profiles') +// .select('delivery_enabled') +// .eq('user_id', uuid) +// } + export async function fetchUserByUUID( uuid: string, ): Promise> { try { const { data: user, error } = await supabase - .from('Users') + .from('profiles') .select('*') .eq('user_id', uuid) .single(); @@ -65,7 +74,7 @@ export async function addUserAddress( ): Promise> { try { const { data: existingUser, error: selectError } = await supabase - .from('Users') + .from('profiles') .select('street, city, zipcode') .eq('user_id', uuid) .single(); @@ -81,7 +90,7 @@ export async function addUserAddress( const updatedZipcode = [...(existingUser?.zipcode || []), newZipcode]; const { data, error } = await supabase - .from('Users') + .from('profiles') .update({ street: updatedStreet, city: updatedCity, diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index 3f10f073..23f5b62f 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -4,34 +4,45 @@ import { useRouter } from "next/navigation"; import supabase from "@/api/supabase/createClient"; import { Button } from "../login/styles"; import { User } from "@/schema/schema"; +import { useEffect } from "react"; + +// console.log( user); + +// const userDelivery = async () => { +// const { data, error } = await supabase +// .from('profiles') +// .select() +// .eq('user_id', user?.id) +// .single() +// } -const { data: { user } } = async (): Promise => { - await supabase.auth.getUser() -}; -console.log(user); -const userDelivery = user; -const { data, error } = await supabase - .from('profiles') - .select('delivery_enabled') - .eq('user_id', user?.id) export default function Checkout() { const router = useRouter(); - - const checkDelivery = () => { - if (userDelivery) { - router.push('/delivery'); - } else { - router.push('/pickup'); + useEffect(() => { + const getCurrentUser = async () => { + const { data: { user } } = await supabase.auth.getUser() + return user } - }; + getCurrentUser(); + }, []) + + + + // const checkDelivery = () => { + // if (data) { + // router.push('/delivery'); + // } else { + // router.push('/pickup'); + // } + // }; return (
- - {/*
Checkout
*/} + */} +
Checkout
); } From 3f35f4984e87596496d19f6e0beb978bd58904f0 Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:44:34 -0700 Subject: [PATCH 04/12] wip checkout function --- src/api/supabase/queries/user_queries.ts | 21 +++++++ src/app/checkout/page.tsx | 75 ++++++++++++++++++------ 2 files changed, 77 insertions(+), 19 deletions(-) diff --git a/src/api/supabase/queries/user_queries.ts b/src/api/supabase/queries/user_queries.ts index e9c5c9f3..4673daca 100644 --- a/src/api/supabase/queries/user_queries.ts +++ b/src/api/supabase/queries/user_queries.ts @@ -45,6 +45,27 @@ export async function fetchUserData(): Promise< // .eq('user_id', uuid) // } +export async function fetchDeliveryByUUID( + uuid: string, +): Promise { + try { + const { data, error } = await supabase + .from('profiles') + .select('delivery_allowed') + .eq('user_id', uuid) + .single(); + + if (error) { + console.error('Error fetching user data:', error); + } + + return data; + } catch (error) { + console.error('Error:', error); + throw error; + } +} + export async function fetchUserByUUID( uuid: string, ): Promise> { diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index 23f5b62f..54b1620f 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -1,10 +1,11 @@ 'use client'; import { useRouter } from "next/navigation"; +import { useEffect, useState } from "react"; import supabase from "@/api/supabase/createClient"; import { Button } from "../login/styles"; import { User } from "@/schema/schema"; -import { useEffect } from "react"; +import { fetchDeliveryByUUID, fetchUserByUUID } from "@/api/supabase/queries/user_queries"; // console.log( user); @@ -17,32 +18,68 @@ import { useEffect } from "react"; // } +// export default function Checkout() { +// const router = useRouter(); +// useEffect(() => { +// (async () => { +// const {data, error} = await supabase.auth.getSession(); +// if (error) throw error; + +// }) + export default function Checkout() { - const router = useRouter(); + const [deliveryEnabled, setDeliveryEnabled] = useState(false); useEffect(() => { - const getCurrentUser = async () => { - const { data: { user } } = await supabase.auth.getUser() - return user - } - getCurrentUser(); - }, []) - + (async () => { + const { data: sessionData, error } = await supabase.auth.getSession(); + if (error) throw error; + if ( + !sessionData || + !sessionData.session || + !sessionData.session.user || + !sessionData.session.user.id + ) + return; - // const checkDelivery = () => { - // if (data) { - // router.push('/delivery'); - // } else { - // router.push('/pickup'); - // } - // }; + const data = await fetchUserByUUID(sessionData.session.user.id as string); + + setDeliveryEnabled(data); + })(); + }, []); + // const getCurrentUser: Promise = async () => { + // const { data: { user } } = await supabase.auth.getUser(); + // if (user !== null) { + // return user.id; + // } + // console.log("No user logged in."); + // } + // getCurrentUser().then((value) => { + // const userId: string = value; + // const deliveryOption = fetchDeliveryByUUID(userId); + // console.log(deliveryOption) + // }); + const router = useRouter(); + const checkDelivery = () => { + + } return (
- {/* */} -
Checkout
+ + {/*
Checkout
*/}
); } + + + + // const checkDelivery = () => { + // if (data) { + // router.push('/delivery'); + // } else { + // router.push('/pickup'); + // } + // }; \ No newline at end of file From e22ad384bc5dfa3fd004573b4c50413cb39d788d Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Wed, 25 Oct 2023 18:07:33 -0700 Subject: [PATCH 05/12] update types --- src/api/supabase/queries/user_queries.ts | 7 ++++--- src/schema/schema.ts | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/api/supabase/queries/user_queries.ts b/src/api/supabase/queries/user_queries.ts index 4673daca..18ef8b4a 100644 --- a/src/api/supabase/queries/user_queries.ts +++ b/src/api/supabase/queries/user_queries.ts @@ -47,12 +47,13 @@ export async function fetchUserData(): Promise< export async function fetchDeliveryByUUID( uuid: string, -): Promise { +): Promise { try { const { data, error } = await supabase .from('profiles') - .select('delivery_allowed') - .eq('user_id', uuid) + // .select('delivery_allowed') + .select('*') + // .eq('user_id', uuid) .single(); if (error) { diff --git a/src/schema/schema.ts b/src/schema/schema.ts index 3b994e80..2c0ed331 100644 --- a/src/schema/schema.ts +++ b/src/schema/schema.ts @@ -6,7 +6,7 @@ export type User = { last_name: string; pet_information: string; delivery_allowed: boolean; - created_at: Date; // index of the address the street, city, and zipcode to build the address + created_at: Date; // timestamp of when record was created cart_id: string; // UUID address_id: string; // UUID }; @@ -20,9 +20,9 @@ export type Order = { export type Schedule = { id: number; // bigint generated by default as identity - date: string; // text not null - start_time: string; // text null - end_time: string; // text null + date: Date; // text not null + start_time: Date; // text null + end_time: Date; // text null }; export type Product = { @@ -32,5 +32,5 @@ export type Product = { category: string; // numeric not null; quantity: number; // numeric not null; photo: string; // text null; - updated_at: string; // timestamp with time zone not null default now(); + updated_at: Date; // timestamp with time zone not null default now(); }; From 23b81ad234e80d0875220b3ea81082f53cd8ee77 Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:29:34 -0700 Subject: [PATCH 06/12] wip delivery query --- src/api/supabase/queries/user_queries.ts | 16 +++------------- src/app/checkout/page.tsx | 8 ++++++-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/api/supabase/queries/user_queries.ts b/src/api/supabase/queries/user_queries.ts index 18ef8b4a..64dd7d58 100644 --- a/src/api/supabase/queries/user_queries.ts +++ b/src/api/supabase/queries/user_queries.ts @@ -36,24 +36,14 @@ export async function fetchUserData(): Promise< } } -// export async function fetchUserDelivery( -// uuid: string -// ) { -// const { error } = await supabase -// .from('profiles') -// .select('delivery_enabled') -// .eq('user_id', uuid) -// } - export async function fetchDeliveryByUUID( uuid: string, -): Promise { +) { try { const { data, error } = await supabase .from('profiles') - // .select('delivery_allowed') - .select('*') - // .eq('user_id', uuid) + .select('delivery_allowed') + .eq('user_id', uuid) .single(); if (error) { diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index 54b1620f..ca88a33d 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -43,7 +43,6 @@ export default function Checkout() { return; const data = await fetchUserByUUID(sessionData.session.user.id as string); - setDeliveryEnabled(data); })(); @@ -62,7 +61,12 @@ export default function Checkout() { // }); const router = useRouter(); const checkDelivery = () => { - + if (data) { + router.push("/delivery") + } + else { + router.push("/pickup") + } } return (
From 5f83d0f2b54dd166f0a1aab401006859b7c07f3d Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:35:20 -0700 Subject: [PATCH 07/12] conditional nav working --- src/api/supabase/queries/user_queries.ts | 2 +- src/app/checkout/page.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/api/supabase/queries/user_queries.ts b/src/api/supabase/queries/user_queries.ts index 64dd7d58..da0aecf7 100644 --- a/src/api/supabase/queries/user_queries.ts +++ b/src/api/supabase/queries/user_queries.ts @@ -59,7 +59,7 @@ export async function fetchDeliveryByUUID( export async function fetchUserByUUID( uuid: string, -): Promise> { +) { try { const { data: user, error } = await supabase .from('profiles') diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index ca88a33d..cb2ba93f 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -43,8 +43,7 @@ export default function Checkout() { return; const data = await fetchUserByUUID(sessionData.session.user.id as string); - - setDeliveryEnabled(data); + setDeliveryEnabled(data.delivery_allowed); })(); }, []); // const getCurrentUser: Promise = async () => { @@ -61,7 +60,7 @@ export default function Checkout() { // }); const router = useRouter(); const checkDelivery = () => { - if (data) { + if (deliveryEnabled) { router.push("/delivery") } else { From 6cc5e2b0fbd39fe65aacebf128ccf6fd24c8d597 Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:39:32 -0700 Subject: [PATCH 08/12] remove obsolete query & comments --- src/api/supabase/queries/user_queries.ts | 21 ----------- src/app/checkout/page.tsx | 47 ++---------------------- 2 files changed, 3 insertions(+), 65 deletions(-) diff --git a/src/api/supabase/queries/user_queries.ts b/src/api/supabase/queries/user_queries.ts index da0aecf7..df3b9e37 100644 --- a/src/api/supabase/queries/user_queries.ts +++ b/src/api/supabase/queries/user_queries.ts @@ -36,27 +36,6 @@ export async function fetchUserData(): Promise< } } -export async function fetchDeliveryByUUID( - uuid: string, -) { - try { - const { data, error } = await supabase - .from('profiles') - .select('delivery_allowed') - .eq('user_id', uuid) - .single(); - - if (error) { - console.error('Error fetching user data:', error); - } - - return data; - } catch (error) { - console.error('Error:', error); - throw error; - } -} - export async function fetchUserByUUID( uuid: string, ) { diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index cb2ba93f..d1b334a1 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -5,27 +5,7 @@ import { useEffect, useState } from "react"; import supabase from "@/api/supabase/createClient"; import { Button } from "../login/styles"; import { User } from "@/schema/schema"; -import { fetchDeliveryByUUID, fetchUserByUUID } from "@/api/supabase/queries/user_queries"; - -// console.log( user); - -// const userDelivery = async () => { -// const { data, error } = await supabase -// .from('profiles') -// .select() -// .eq('user_id', user?.id) -// .single() -// } - - -// export default function Checkout() { -// const router = useRouter(); -// useEffect(() => { -// (async () => { -// const {data, error} = await supabase.auth.getSession(); -// if (error) throw error; - -// }) +import { fetchUserByUUID } from "@/api/supabase/queries/user_queries"; export default function Checkout() { const [deliveryEnabled, setDeliveryEnabled] = useState(false); @@ -46,18 +26,7 @@ export default function Checkout() { setDeliveryEnabled(data.delivery_allowed); })(); }, []); - // const getCurrentUser: Promise = async () => { - // const { data: { user } } = await supabase.auth.getUser(); - // if (user !== null) { - // return user.id; - // } - // console.log("No user logged in."); - // } - // getCurrentUser().then((value) => { - // const userId: string = value; - // const deliveryOption = fetchDeliveryByUUID(userId); - // console.log(deliveryOption) - // }); + const router = useRouter(); const checkDelivery = () => { if (deliveryEnabled) { @@ -75,14 +44,4 @@ export default function Checkout() { {/*
Checkout
*/}
); -} - - - - // const checkDelivery = () => { - // if (data) { - // router.push('/delivery'); - // } else { - // router.push('/pickup'); - // } - // }; \ No newline at end of file +} \ No newline at end of file From 98dc55985e43da8d9cb95d571647d69751dd1592 Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Wed, 25 Oct 2023 20:09:51 -0700 Subject: [PATCH 09/12] remove comment --- src/app/checkout/page.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index d1b334a1..fd73902d 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -41,7 +41,6 @@ export default function Checkout() { - {/*
Checkout
*/} ); } \ No newline at end of file From 7a88cafe8f2bae5364ed98eb1f4cf555a67b6fb7 Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:11:59 -0700 Subject: [PATCH 10/12] remove console.log --- src/api/supabase/auth/auth.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/api/supabase/auth/auth.tsx b/src/api/supabase/auth/auth.tsx index ea108d9e..7ea5f70b 100644 --- a/src/api/supabase/auth/auth.tsx +++ b/src/api/supabase/auth/auth.tsx @@ -11,9 +11,6 @@ export const handleSignUp = async (email: string, password: string) => { }; export const signInWithEmail = async (email: string, password: string) => { - console.log('hi'); - console.log(email) - console.log(password) const { data, error } = await supabase.auth.signInWithPassword({ email, password, From efbb2953139d955e814906b152214d3d1e04b50b Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:20:23 -0700 Subject: [PATCH 11/12] prettier --- src/api/supabase/queries/user_queries.ts | 4 +-- src/app/checkout/page.tsx | 35 +++++++++++------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/api/supabase/queries/user_queries.ts b/src/api/supabase/queries/user_queries.ts index f711d4d6..05f67306 100644 --- a/src/api/supabase/queries/user_queries.ts +++ b/src/api/supabase/queries/user_queries.ts @@ -37,9 +37,7 @@ export async function fetchUserData(): Promise< } } -export async function fetchUserByUUID( - uuid: string, -) { +export async function fetchUserByUUID(uuid: string) { try { const { data: user, error } = await supabase .from('profiles') diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index 9206a98e..8d12eb23 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -1,15 +1,15 @@ 'use client'; -import { useRouter } from "next/navigation"; -import { useEffect, useState } from "react"; -import supabase from "@/api/supabase/createClient"; -import { Button } from "../login/styles"; -import { User } from "@/schema/schema"; -import { fetchUserByUUID } from "@/api/supabase/queries/user_queries"; +import { useRouter } from 'next/navigation'; +import { useEffect, useState } from 'react'; +import supabase from '@/api/supabase/createClient'; +import { Button } from '../login/styles'; +import { User } from '@/schema/schema'; +import { fetchUserByUUID } from '@/api/supabase/queries/user_queries'; import NavBar from '../../components/NavBar'; -'use client'; +('use client'); export default function Checkout() { const [deliveryEnabled, setDeliveryEnabled] = useState(false); @@ -31,21 +31,18 @@ export default function Checkout() { })(); }, []); - const router = useRouter(); - const checkDelivery = () => { - if (deliveryEnabled) { - router.push("/delivery") - } - else { - router.push("/pickup") - } + const router = useRouter(); + const checkDelivery = () => { + if (deliveryEnabled) { + router.push('/delivery'); + } else { + router.push('/pickup'); } + }; return (
- +
); -} \ No newline at end of file +} From 49f0fb71c65eee8e18f0ba96e182b6da381173dd Mon Sep 17 00:00:00 2001 From: Casey Lei <63774760+caseyzlei@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:28:20 -0700 Subject: [PATCH 12/12] eslint updated --- .eslintrc.js | 7 ++++++- src/app/checkout/page.tsx | 5 +---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0f2c600d..0d9341d7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,9 +1,14 @@ module.exports = { - extends: ["@calblueprint/eslint-config-react"], + extends: ["@calblueprint/eslint-config-react"], rules: { // Add any custom rules here // Disable the rule that requires React to be in scope -- we don't need this with React 18 'react/react-in-jsx-scope': 'off', 'react/jsx-uses-react': 'off', }, + settings: { + 'import/resolver': { + typescript: {} + } + } }; \ No newline at end of file diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx index 8d12eb23..4ad3c627 100644 --- a/src/app/checkout/page.tsx +++ b/src/app/checkout/page.tsx @@ -3,14 +3,11 @@ import { useRouter } from 'next/navigation'; import { useEffect, useState } from 'react'; import supabase from '@/api/supabase/createClient'; -import { Button } from '../login/styles'; -import { User } from '@/schema/schema'; import { fetchUserByUUID } from '@/api/supabase/queries/user_queries'; +import { Button } from '../login/styles'; import NavBar from '../../components/NavBar'; -('use client'); - export default function Checkout() { const [deliveryEnabled, setDeliveryEnabled] = useState(false); useEffect(() => {