Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyzlei committed Oct 29, 2023
1 parent 7a88caf commit efbb295
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
4 changes: 1 addition & 3 deletions src/api/supabase/queries/user_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
35 changes: 16 additions & 19 deletions src/app/checkout/page.tsx
Original file line number Diff line number Diff line change
@@ -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<boolean>(false);
Expand All @@ -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 (
<main>
<NavBar />
<Button onClick={(checkDelivery)}>
Checkout
</Button>
<Button onClick={checkDelivery}>Checkout</Button>
</main>
);
}
}

0 comments on commit efbb295

Please sign in to comment.