diff --git a/devsoc24-portal-fe/src/app/home/page.tsx b/devsoc24-portal-fe/src/app/home/page.tsx index 54d9034..a8a7f8c 100644 --- a/devsoc24-portal-fe/src/app/home/page.tsx +++ b/devsoc24-portal-fe/src/app/home/page.tsx @@ -14,6 +14,7 @@ import { useTeamStore, useUserStore, showModalStore, + IdeaStore, } from "@/store/store"; import TrackComponent from "@/components/track/TrackComponent"; import toast from "react-hot-toast"; @@ -32,6 +33,7 @@ import Link from "next/link"; import TimelineComponent from "@/components/timeline/timelineComponent"; import LeaveTeam from "@/components/team/leaveTeam"; import Kick from "@/components/team/kick"; +import Sponsors from "@/components/sponsors"; interface ideaProps { message: string; @@ -51,7 +53,7 @@ export default function HomePage() { const { idea, setIdea } = useIdeaStore(); const { team, setTeam } = useTeamStore(); const { user, setUser } = useUserStore(); - const [getIdea, SetIdea] = useState(""); + const {getIdea, SetIdea} = IdeaStore(); const { teamData, setTeamData } = useTeamDataStore(); const { isLeader, setIsLeader } = useLeaderStore(); const { showModal, setShowModal } = showModalStore(); @@ -250,7 +252,7 @@ export default function HomePage() { const ideaCard = [ { text: "Submit An Idea", - showModal: getIdea !== "idea found", + showModal: getIdea !== "idea found" && getIdea !== "", modalType: idea === 409 ? "Choice" : "JoinTeam", routeTo: "/submit-idea", }, @@ -267,7 +269,7 @@ export default function HomePage() { return ( <> - + @@ -337,7 +339,10 @@ export default function HomePage() { : ideaCard } /> - + + + + diff --git a/devsoc24-portal-fe/src/assets/images/contentstack.svg b/devsoc24-portal-fe/src/assets/images/contentstack.svg new file mode 100644 index 0000000..7509abe --- /dev/null +++ b/devsoc24-portal-fe/src/assets/images/contentstack.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/devsoc24-portal-fe/src/assets/images/hallofcricket.svg b/devsoc24-portal-fe/src/assets/images/hallofcricket.svg new file mode 100644 index 0000000..66b5dd8 --- /dev/null +++ b/devsoc24-portal-fe/src/assets/images/hallofcricket.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/devsoc24-portal-fe/src/assets/images/quillbot.svg b/devsoc24-portal-fe/src/assets/images/quillbot.svg new file mode 100644 index 0000000..e9bcaf8 --- /dev/null +++ b/devsoc24-portal-fe/src/assets/images/quillbot.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/devsoc24-portal-fe/src/components/sponsors.tsx b/devsoc24-portal-fe/src/components/sponsors.tsx new file mode 100644 index 0000000..f111a79 --- /dev/null +++ b/devsoc24-portal-fe/src/components/sponsors.tsx @@ -0,0 +1,43 @@ +import Image from "next/image"; +import contentstack from "@/assets/images/contentstack.svg"; +import hallofcricket from "@/assets/images/hallofcricket.svg"; +import quillbot from "@/assets/images/quillbot.svg"; + +function Sponsors() { + return ( + + Sponsors + + + + Title sponsor + + + + + + In Kind sponsor + + + + In Kind sponsor + + + + + ); +} + +export default Sponsors; diff --git a/devsoc24-portal-fe/src/components/team/createTeam.tsx b/devsoc24-portal-fe/src/components/team/createTeam.tsx index 2af30bb..b05c213 100644 --- a/devsoc24-portal-fe/src/components/team/createTeam.tsx +++ b/devsoc24-portal-fe/src/components/team/createTeam.tsx @@ -8,17 +8,39 @@ import { import { Label } from "@/components/ui/label"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; -import axios, { AxiosError } from "axios"; +import axios, { AxiosError, AxiosResponse } from "axios"; import { useRef } from "react"; -import { useTeamDataStore, useTeamStore } from "@/store/store"; +import { + useTeamDataStore, + useTeamStore, + useIdeaStore, + useLeaderStore, + IdeaStore, +} from "@/store/store"; import { useRouter } from "next/navigation"; import { APIResponse } from "@/schemas/api"; import toast from "react-hot-toast"; +interface ideaProps { + message: string; + status: boolean; + data?: { + title: string; + description: string; + track: string; + github_link: string; + figma_link: string; + others: string; + }; +} + function CreateTeam() { const { team, setTeam } = useTeamStore(); const inputRef = useRef(null); const { teamData, setTeamData } = useTeamDataStore(); + const { idea, setIdea } = useIdeaStore(); + const { isLeader, setIsLeader } = useLeaderStore(); + const { getIdea, SetIdea } = IdeaStore(); const router = useRouter(); @@ -33,9 +55,13 @@ function CreateTeam() { withCredentials: true, }, ); - toast.success("Team created successfully!"); - await fetchTeam(); + + setIsLeader(true); + SetIdea(""); + setIdea(409); setTeam(false); + await fetchTeam(); + toast.success("Team created successfully!"); } catch (err) { if (axios.isAxiosError(err)) { switch (err.response?.status) { @@ -65,7 +91,6 @@ function CreateTeam() { }, ); setTeamData(response.data); - setTeam(true); } catch (e) { if (axios.isAxiosError(e)) { switch (e.response?.status) { diff --git a/devsoc24-portal-fe/src/components/team/leaveTeam.tsx b/devsoc24-portal-fe/src/components/team/leaveTeam.tsx index 41f55aa..81c4c7c 100644 --- a/devsoc24-portal-fe/src/components/team/leaveTeam.tsx +++ b/devsoc24-portal-fe/src/components/team/leaveTeam.tsx @@ -3,16 +3,32 @@ import { useTeamStore, useTeamDataStore, showModalStore, + IdeaStore, } from "@/store/store"; -import axios from "axios"; +import axios, { AxiosError, AxiosResponse } from "axios"; import toast from "react-hot-toast"; import { userProps } from "@/interfaces"; import { useRouter } from "next/navigation"; +import { type APIResponse } from "@/schemas/api"; + +interface ideaProps { + message: string; + status: boolean; + data?: { + title: string; + description: string; + track: string; + github_link: string; + figma_link: string; + others: string; + }; +} const LeaveTeam = () => { const { team, setTeam } = useTeamStore(); const { showModal, setShowModal } = showModalStore(); const { teamData, setTeamData } = useTeamDataStore(); + const { getIdea, SetIdea } = IdeaStore(); const router = useRouter(); @@ -26,6 +42,7 @@ const LeaveTeam = () => { }, ); setTeamData(response.data); + } catch (e) { if (axios.isAxiosError(e)) { switch (e.response?.status) { @@ -46,29 +63,30 @@ const LeaveTeam = () => { } }; + const leaveTeam = async () => { const handleClick = async () => { await axios.delete(`${process.env.NEXT_PUBLIC_API_URL}/team/leave`, { withCredentials: true, }); - setShowModal("") + console.log("left team"); + SetIdea("left team"); + void fetchTeam(); + setTeam(true); + setShowModal(""); }; await toast.promise(handleClick(), { loading: "Loading...", success: () => { - setTeam(true); - void fetchTeam(); return `Accepted`; }, error: `Something went wrong`, }); - - }; return ( - + { return ( - + + Track Details - + {tracks.map((item, index) => ( diff --git a/devsoc24-portal-fe/src/store/store.tsx b/devsoc24-portal-fe/src/store/store.tsx index a38f3f3..7778f3e 100644 --- a/devsoc24-portal-fe/src/store/store.tsx +++ b/devsoc24-portal-fe/src/store/store.tsx @@ -144,4 +144,14 @@ interface kickStore { export const showkickStore = create((set) => ({ kickMate: "", setKickMate: (kickMate: string) => set({ kickMate }), -})); +})); + +interface ideaInterface { + getIdea: string; + SetIdea: (idea: string) => void; +} + +export const IdeaStore = create((set) => ({ + getIdea: "", + SetIdea: (getIdea: string) => set({ getIdea }), +})); \ No newline at end of file
Title sponsor
In Kind sponsor