diff --git a/devsoc24-portal-fe/public/images/trackImg1.svg b/devsoc24-portal-fe/public/images/trackImg1.svg new file mode 100644 index 0000000..5fc3720 --- /dev/null +++ b/devsoc24-portal-fe/public/images/trackImg1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/devsoc24-portal-fe/src/app/login/login-form.tsx b/devsoc24-portal-fe/src/app/login/login-form.tsx index 686e0a1..fec6759 100644 --- a/devsoc24-portal-fe/src/app/login/login-form.tsx +++ b/devsoc24-portal-fe/src/app/login/login-form.tsx @@ -42,6 +42,9 @@ export default function LoginForm() { const { data } = await axios.post( `${process.env.NEXT_PUBLIC_API_URL}/login`, { email: formVal.email, password: formVal.password }, + { + withCredentials: true, + }, ); toast.update(toastId, { render: ( diff --git a/devsoc24-portal-fe/src/app/page.tsx b/devsoc24-portal-fe/src/app/page.tsx index 3cb8a1f..9c68dc4 100644 --- a/devsoc24-portal-fe/src/app/page.tsx +++ b/devsoc24-portal-fe/src/app/page.tsx @@ -14,6 +14,7 @@ import { userProps, } from "@/store/store"; import Loading from "./loading"; +import TrackComponent from "@/components/track/TrackComponent"; interface ideaProps { message: string; @@ -76,18 +77,18 @@ export default function HomePage() { const { user, setUser } = useUserStore(); const [teamData, setTeamData] = useState(null); - const login = async () => { - const response = await axios.post( - `${process.env.NEXT_PUBLIC_API_URL}/login`, - { - email: "abhinav@gmail.com", - password: "123456", - }, - { - withCredentials: true, - }, - ); - }; + // const login = async () => { + // const response = await axios.post( + // `${process.env.NEXT_PUBLIC_API_URL}/login`, + // { + // email: "abhinav@gmail.com", + // password: "123456", + // }, + // { + // withCredentials: true, + // }, + // ); + // }; const fetchData = async () => { try { @@ -162,7 +163,7 @@ export default function HomePage() { useEffect(() => { const fetchDataAndLogin = async () => { - await login(); + // await login(); await fetchData(); await fetchIdea(); }; @@ -201,33 +202,32 @@ export default function HomePage() { const router = useRouter(); return ( - }> -
-
- - title -
-
- {team ? ( - - ) : ( - - )} +
+
+ + title +
+
+ {team ? ( -
-
- + ) : ( + + )} + + +
+
); } diff --git a/devsoc24-portal-fe/src/app/signup/details/personal-details-form.tsx b/devsoc24-portal-fe/src/app/signup/details/personal-details-form.tsx index 4abb8f4..d1f2e54 100644 --- a/devsoc24-portal-fe/src/app/signup/details/personal-details-form.tsx +++ b/devsoc24-portal-fe/src/app/signup/details/personal-details-form.tsx @@ -21,7 +21,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; type PersonalDetailsFormValues = z.infer; @@ -47,23 +47,32 @@ export default function PersonalDetails({ gender: undefined, }, mode: "onChange", + shouldUnregister: false, }); - + const [gender, setGender] = useState(""); useEffect(() => { form.setValue("firstName", localStorage.getItem("first_name") ?? ""); form.setValue("lastName", localStorage.getItem("last_name") ?? ""); form.setValue("email", email ?? ""); form.setValue("phoneNumber", localStorage.getItem("phone_number") ?? ""); form.setValue("country", localStorage.getItem("country") ?? "+91"); + const temp = localStorage.getItem("gender") as + | "Male" + | "Female" + | "Others" + | "Prefer Not to Say"; + + setGender(temp); + }, []); + + useEffect(() => { form.setValue( "gender", - (localStorage.getItem("gender") as - | "Male" - | "Female" - | "Others" - | "Prefer Not to Say") ?? undefined, + gender as "Male" | "Female" | "Others" | "Prefer Not to Say", ); - }, []); + setGender(form.getValues("gender")); + console.log("Form Values:", form.getValues()); + }, [gender]); async function onSubmit(data: PersonalDetailsFormValues) { localStorage.setItem("first_name", data.firstName); @@ -217,7 +226,10 @@ export default function PersonalDetails({ render={({ field }) => ( Gender - diff --git a/devsoc24-portal-fe/src/app/test/page.tsx b/devsoc24-portal-fe/src/app/test/page.tsx new file mode 100644 index 0000000..707940c --- /dev/null +++ b/devsoc24-portal-fe/src/app/test/page.tsx @@ -0,0 +1,12 @@ +import TrackComponent from "@/components/track/TrackComponent"; +import React from "react"; + +const Page = () => { + return ( +
+ +
+ ); +}; + +export default Page; diff --git a/devsoc24-portal-fe/src/components/customCard.tsx b/devsoc24-portal-fe/src/components/customCard.tsx index 7e27ae9..7d40a7c 100644 --- a/devsoc24-portal-fe/src/components/customCard.tsx +++ b/devsoc24-portal-fe/src/components/customCard.tsx @@ -23,7 +23,7 @@ function CustomCard(props: CardProps) { return ( <> -
+
{title}
diff --git a/devsoc24-portal-fe/src/components/teamCard.tsx b/devsoc24-portal-fe/src/components/teamCard.tsx index 098c362..4e916c0 100644 --- a/devsoc24-portal-fe/src/components/teamCard.tsx +++ b/devsoc24-portal-fe/src/components/teamCard.tsx @@ -49,7 +49,7 @@ const TeamCard: React.FC = (props) => { return ( <>
-
+
Your Devsoc Team
diff --git a/devsoc24-portal-fe/src/components/track/TrackCard.tsx b/devsoc24-portal-fe/src/components/track/TrackCard.tsx new file mode 100644 index 0000000..81e0c48 --- /dev/null +++ b/devsoc24-portal-fe/src/components/track/TrackCard.tsx @@ -0,0 +1,21 @@ +import React from "react"; +import Image from "next/image"; + +const TrackCard = (props: { name: string; imagesrc: string }) => { + return ( +
+ track image +
+ {props.name} +
+
+ ); +}; + +export default TrackCard; diff --git a/devsoc24-portal-fe/src/components/track/TrackComponent.tsx b/devsoc24-portal-fe/src/components/track/TrackComponent.tsx new file mode 100644 index 0000000..0f7bd4f --- /dev/null +++ b/devsoc24-portal-fe/src/components/track/TrackComponent.tsx @@ -0,0 +1,45 @@ +import React from "react"; +import TrackCard from "./TrackCard"; + +const tracks = [ + { + imgsrc: "/images/trackImg1.svg", + name: "Secret Track 1", + }, + { + imgsrc: "/images/trackImg1.svg", + name: "Secret Track 2", + }, + { + imgsrc: "/images/trackImg1.svg", + name: "Secret Track 3", + }, + { + imgsrc: "/images/trackImg1.svg", + name: "Secret Track 4", + }, + { + imgsrc: "/images/trackImg1.svg", + name: "Secret Track 5", + }, + { + imgsrc: "/images/trackImg1.svg", + name: "Secret Track 6", + }, +]; +const TrackComponent = () => { + return ( +
+
+ Track Details +
+
+ {tracks.map((item, index) => ( + + ))} +
+
+ ); +}; + +export default TrackComponent; diff --git a/devsoc24-portal-fe/src/styles/globals.css b/devsoc24-portal-fe/src/styles/globals.css index 177aef6..fe1e567 100644 --- a/devsoc24-portal-fe/src/styles/globals.css +++ b/devsoc24-portal-fe/src/styles/globals.css @@ -88,4 +88,22 @@ /* Black color */ /* Rounded corners */ +} + +/* Track Component Scrollbar */ +.trackComponent::-webkit-scrollbar { + width: 3px; /* Width of the scrollbar */ +} + +.trackComponent::-webkit-scrollbar-track { + background: #f1f1f1; /* Color of the scrollbar track */ +} + +.trackComponent::-webkit-scrollbar-thumb { + background: #888; /* Color of the scrollbar thumb */ + border-radius: 6px; /* Roundness of the scrollbar thumb */ +} + +.trackComponent::-webkit-scrollbar-thumb:hover { + background: #555; /* Color of the scrollbar thumb on hover */ } \ No newline at end of file