Skip to content

Commit

Permalink
Merge pull request #981 from IET-NITK/expo24
Browse files Browse the repository at this point in the history
added expo projects
  • Loading branch information
iet-nitk-575025 authored Mar 21, 2024
2 parents 1527691 + 748f17b commit ae1623f
Show file tree
Hide file tree
Showing 9 changed files with 6,215 additions and 17 deletions.
5,956 changes: 5,956 additions & 0 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

236 changes: 235 additions & 1 deletion public/project-response.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/app/expo/page.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import styles from "./expo.module.css"
import ProjectList from '@/components/project/projectList';

const Page = () => {
return (
<div className='text-center mt-24 h-[70vh] font-semibold'>
<div className='text-center mt-24 min-h-[70vh] font-semibold'>
<section className={`w-full mb-8 px-8 max-h-[250px] flex items-center justify-between 2xl:justify-around mt-20 bg-[#461461] relative ${styles.font} overflow-hidden`}>
<div className="py-12 justify-start text-left text-white">
Project<br /> Expo'24
</div>
<img src="/CommUnity.png" className='object-cover' />
</section>
Expo projects coming soon..
<ProjectList img="" sig="" tag="expo24"/>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/app/projects/cipher/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Page = () => {
return (
<div>
<section>
<ProjectList img="cipher" sig="Cipher"/>
<ProjectList img="cipher" sig="Cipher" tag=""/>
</section>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/projects/rovisp/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Page = () => {
return (
<div>
<section>
<ProjectList img="rovisp" sig="Rovisp"/>
<ProjectList img="rovisp" sig="Rovisp" tag=""/>
</section>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/projects/torsion/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Page = () => {
return (
<div>
<section>
<ProjectList img="torsion" sig="Torsion"/>
<ProjectList img="torsion" sig="Torsion" tag=""/>
</section>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/projects/venture/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Page = () => {
return (
<div>
<section>
<ProjectList img="venture" sig="Venture"/>
<ProjectList img="venture" sig="Venture" tag=""/>
</section>
</div>
);
Expand Down
23 changes: 15 additions & 8 deletions src/components/ProjectsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ProjectsPage = ({ projects, tag, img, sig }) => {
setCurrentPage(data.selected);
};

if (tag) {
if (tag != "") {
projects = projects.filter(project => project.project_tags.toLowerCase().includes(tag.toLowerCase()))
}

Expand All @@ -36,17 +36,24 @@ const ProjectsPage = ({ projects, tag, img, sig }) => {

const indexOfLastProject = (currentPage + 1) * projectsPerPage;
const indexOfFirstProject = indexOfLastProject - projectsPerPage;
const currentProjects = projects.filter(project => project.project_sig.toLowerCase() == sig.toLowerCase()).filter(project => project.project_year == selectedOption).slice(indexOfFirstProject, indexOfLastProject);
let currentProjects
if (tag == "expo24") {
currentProjects = projects.slice(indexOfFirstProject, indexOfLastProject);
} else {
currentProjects = projects.filter(project => project.project_sig.toLowerCase() == sig.toLowerCase()).filter(project => project.project_year == selectedOption).slice(indexOfFirstProject, indexOfLastProject);
}
const pageCount = Math.ceil(projects.length / projectsPerPage);

return (
<main className='min-h-[90vh] relative'>
<section className={`w-full ${img == 'cipher' ? 'bg-cipher-background' : (img == 'venture' ? 'bg-venture-background' : (img == 'rovisp' ? 'bg-rovisp-background' : 'bg-torsion-background'))} bg-cover relative`}>
<div className="z-20 w-screen bg-black/60 relative text-center font-semibold text-4xl py-32 flex justify-center text-white mx-auto">
{sig} Projects
</div>
</section>
{currentProjects.length > 0 &&
{tag != "expo24" &&
<section className={`w-full ${img == 'cipher' ? 'bg-cipher-background' : (img == 'venture' ? 'bg-venture-background' : (img == 'rovisp' ? 'bg-rovisp-background' : 'bg-torsion-background'))} bg-cover relative`}>
<div className="z-20 w-screen bg-black/60 relative text-center font-semibold text-4xl py-32 flex justify-center text-white mx-auto">
{sig} Projects
</div>
</section>
}
{(currentProjects.length > 0 && tag != "expo24") &&
<div className="flex gap-3 flex-col items-center mt-3">
<div display="flex">
<ul className="flex p-0 m-0 w-full bg-[#ebe5ec] border-[1px] border-[#71287e] rounded-lg list-none shadow-md">
Expand Down
4 changes: 2 additions & 2 deletions src/components/project/projectList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ProjectsPage from "@/components/ProjectsPage";
import { fetchProjects } from '@/components/api';
import { useSearchParams } from 'next/navigation'

export default function ProjectList({ img, sig }) {
export default function ProjectList({ img, sig, tag }) {
const [projects, setProjects] = useState([]);

useEffect(() => {
Expand All @@ -19,7 +19,7 @@ export default function ProjectList({ img, sig }) {

const searchParams = useSearchParams()

const tag = searchParams.get('tag')
// const tag = searchParams.get('tag')

return (
<div>
Expand Down

0 comments on commit ae1623f

Please sign in to comment.