generated from CodeChefVIT/template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
170 additions
and
50 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<teamDataProps | null>(null); | ||
|
||
const login = async () => { | ||
const response = await axios.post( | ||
`${process.env.NEXT_PUBLIC_API_URL}/login`, | ||
{ | ||
email: "[email protected]", | ||
password: "123456", | ||
}, | ||
{ | ||
withCredentials: true, | ||
}, | ||
); | ||
}; | ||
// const login = async () => { | ||
// const response = await axios.post( | ||
// `${process.env.NEXT_PUBLIC_API_URL}/login`, | ||
// { | ||
// email: "[email protected]", | ||
// 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 ( | ||
<Suspense fallback={<Loading />}> | ||
<main className="flex min-h-screen flex-col items-start overflow-x-hidden bg-[#F4F5FA]"> | ||
<div className="flex h-[10%] w-full items-center gap-x-8 bg-background px-6 py-2"> | ||
<Logo className="h-9/10 w-auto" /> | ||
<Image src={Dashtitle as HTMLImageElement} alt="title" /> | ||
</div> | ||
<div className="mt-4 flex w-full flex-col gap-4 px-4 md:flex-row md:flex-wrap"> | ||
{team ? ( | ||
<CustomCard | ||
title="Your Devsoc Team" | ||
cardImage="teamCardImg" | ||
cardContent="No Team Members Yet?" | ||
cardDesc="Start A New Team or Join One" | ||
buttonDetails={noTeamCard} | ||
/> | ||
) : ( | ||
<TeamCard {...teamData} /> | ||
)} | ||
<main className="flex h-fit lg:h-screen flex-col items-start overflow-y-auto overflow-x-hidden bg-[#F4F5FA]"> | ||
<div className="flex h-[10%] w-full items-center gap-x-8 bg-background px-6 py-2"> | ||
<Logo className="h-9/10 w-auto" /> | ||
<Image src={Dashtitle as HTMLImageElement} alt="title" /> | ||
</div> | ||
<div className="mt-4 flex h-fit w-full flex-col justify-evenly gap-4 overflow-y-auto px-4 md:flex-row lg:h-[85%]"> | ||
{team ? ( | ||
<CustomCard | ||
title="Idea Submission" | ||
cardImage="ideaSubmissionImg" | ||
cardContent="No Idea Submitted yet" | ||
cardDesc="Submit Your Idea Before < date > <div time >" | ||
buttonDetails={ideaCard} | ||
title="Your Devsoc Team" | ||
cardImage="teamCardImg" | ||
cardContent="No Team Members Yet?" | ||
cardDesc="Start A New Team or Join One" | ||
buttonDetails={noTeamCard} | ||
/> | ||
</div> | ||
</main> | ||
</Suspense> | ||
) : ( | ||
<TeamCard {...teamData} /> | ||
)} | ||
<CustomCard | ||
title="Idea Submission" | ||
cardImage="ideaSubmissionImg" | ||
cardContent="No Idea Submitted yet" | ||
cardDesc="Submit Your Idea Before < date > <div time >" | ||
buttonDetails={ideaCard} | ||
/> | ||
<TrackComponent /> | ||
</div> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import TrackComponent from "@/components/track/TrackComponent"; | ||
import React from "react"; | ||
|
||
const Page = () => { | ||
return ( | ||
<div className="h-screen w-screen bg-black flex items-center justify-center"> | ||
<TrackComponent /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import Image from "next/image"; | ||
|
||
const TrackCard = (props: { name: string; imagesrc: string }) => { | ||
return ( | ||
<div className="h-fit w-fit overflow-hidden rounded-2xl"> | ||
<Image | ||
src={props.imagesrc} | ||
alt="track image" | ||
height={0} | ||
width={0} | ||
className="h-fit w-full" | ||
/> | ||
<div className="flex h-[40px] w-full items-center bg-[#3B3B3B] pl-4 font-semibold text-white"> | ||
{props.name} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TrackCard; |
45 changes: 45 additions & 0 deletions
45
devsoc24-portal-fe/src/components/track/TrackComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<div className="trackComponent h-full overflow-auto rounded-xl w-full md:w-[32vw] bg-white px-6"> | ||
<div className="pl-3 pt-2 font-semibold text-[#45464E]"> | ||
Track Details | ||
</div> | ||
<div className="my-6 flex w-full flex-col items-center gap-6"> | ||
{tracks.map((item, index) => ( | ||
<TrackCard imagesrc={item.imgsrc} name={item.name} key={index} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TrackComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters