diff --git a/src/components/Challenges/ChallengeTile.jsx b/src/components/Challenges/ChallengeTile.jsx new file mode 100644 index 0000000..7047c72 --- /dev/null +++ b/src/components/Challenges/ChallengeTile.jsx @@ -0,0 +1,41 @@ +import { tv } from "tailwind-variants/lite"; +import Button from "../Button"; +import { FaArrowRight } from "react-icons/fa6"; + +const tileVariants = tv({ + base: 'font-poppins flex flex-col justify-start py-6 px-4 rounded-lg shadow-[0_4px_15px_rgba(0,0,0,0.25)]', + + variants: { + size: { + sm: 'h-[222px]', + lg: 'h-[222px] md:h-[340px]' + }, + span: { + 2: 'col-span-1 md:col-span-2', + 3: 'col-span-1 md:col-span-3' + } + }, +}); + +export default function ChallengeTile({ size, span, title, subtitle, tags, to }){ + return ( +
+
+
+

{title}

+

{subtitle}

+
+ {/* tag and button */} +
+

{tags}

+
+
+
+ ); +}; \ No newline at end of file diff --git a/src/pages/Challenges.jsx b/src/pages/Challenges.jsx index 388a9dd..3ca2792 100644 --- a/src/pages/Challenges.jsx +++ b/src/pages/Challenges.jsx @@ -1,66 +1,56 @@ -import { db } from "../firebase"; -import { doc, setDoc, updateDoc, getDoc } from "firebase/firestore"; import Button from "../components/Button"; -import { useState } from "react"; +import ChallengeTile from "../components/Challenges/ChallengeTile"; export default function Challenges() { - // use state to use data - const [teamData, setTeamData] = useState(null); - - // add a new document in the collection test function - async function writeTestDoc() { - // create a collection with a document called team - try { - await setDoc(doc(db, "test", "team"), { - name: "Mint Chip Mavericks", - sprintsCompleted: 3 - }); - console.log("New Team data added") - } catch (error) { - console.error("The error found", error); - }; - }; - - // update data in an existing doc - async function addDataToDoc() { - const teamDocRef = doc(db, "test", "team") - await updateDoc(teamDocRef, { - members: 3 - }); - - console.log("New field added"); - }; - - // read data in the doc to display - async function readTestDoc() { - const teamDocRef = doc(db, "test", "team"); - const teamDocSnap = await getDoc(teamDocRef); - - if (teamDocSnap.exists()) { - console.log("document data", teamDocSnap.data()); - setTeamData(teamDocSnap.data()); - } else { - console.log("there is no data") - }; - }; - return ( -
-

Challenges Page! 🎉

- - {/* test write document button */} -
+
+ {/* title section */} +
+

Which task would you like to work on today?

+
+ + {/* challenge tile grid */} +
+ {/* row 1 */} + + + + + {/* row 2 */} + + +
+
); }; \ No newline at end of file