diff --git a/src/app/(app)/shop/page.tsx b/src/app/(app)/shop/page.tsx index 19507db..766be17 100644 --- a/src/app/(app)/shop/page.tsx +++ b/src/app/(app)/shop/page.tsx @@ -1,49 +1,122 @@ "use client"; import { useDevice } from "@/lib/context/DeviceContext"; +import React, { useState } from "react"; -function Mobile() { - const { isAuthenticated, session } = useDevice(); - return ( -
-

- {isAuthenticated ? `Welcome, ${session.username} !!` : ""} +// please change names of pics below + +const defaultPics = [ + "/pfps/default1.png", + "/pfps/default2.png", + "/pfps/default3.png", + "/pfps/default4.png", +]; + +const purchasablePics = [ + { src: "/pfps/pic1.png", price: 250 }, + { src: "/pfps/pic2.png", price: 250 }, + { src: "/pfps/pic3.png", price: 2000 }, + { src: "/pfps/pic4.png", price: 2000 }, + { src: "/pfps/pic5.png", price: 2000 }, + { src: "/pfps/pic6.png", price: 2000 }, + { src: "/pfps/pic11.png", price: 2000 }, + { src: "/pfps/pic12.png", price: 2000 }, + { src: "/pfps/pic7.png", price: 10000 }, + { src: "/pfps/pic8.png", price: 10000 }, + { src: "/pfps/pic9.png", price: 10000 }, + { src: "/pfps/pic10.png", price: 10000 }, +]; + +export default function ShopPage() { + const { isAuthenticated, session } = useDevice(); + const [totalPoints, setTotalPoints] = useState(0); // placeholder PLEASE PUT SMTH HERE + const [ownedPics, setOwnedPics] = useState([...defaultPics]); + const [currentPic, setCurrentPic] = useState(defaultPics[0]); + + const handlePurchase = (src: string, price: number) => { + if (ownedPics.includes(src)) return; + if (totalPoints >= price) { + setTotalPoints(totalPoints - price); + setOwnedPics([...ownedPics, src]); + } else { + alert("Not enough points!"); + } + }; + + return ( +
+ {/* User Header */} +
+
+ Current PFP +
+
+
+

+ {isAuthenticated ? session.username : "Username"}

- {isAuthenticated ? ( -
- -
- ) : ( -
- - -
- )} -

- ); -} + + + -function Web() { - const { isAuthenticated, session } = useDevice(); +
+

Total Points

+

{totalPoints}

+
- return ( -
-

- {isAuthenticated ? `Welcome, ${session.username} !!` : ""} -

-
- ); -} -export default function Home() { - const { isMobile, isSafari } = useDevice(); - if (isMobile && isSafari) return Mobile(); - else return Web(); +
+
+

Default Profile Pics

+
+
+ {defaultPics.map((src) => ( + Default PFP + ))} +
+
+ + {/* Shop Grid */} +
+
+

Purchase New Profile Pics!

+
+
+ {purchasablePics.map((pic) => ( +
+ PFP +

{pic.price} pts

+ +
+ ))} +
+
+ +
+
+
+
+
+ +
+ ); }