From fd0cc39c6ec2efa0a6766272e9fed61368580c61 Mon Sep 17 00:00:00 2001 From: manasg1111 <118659036+manasg1111@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:05:36 +0530 Subject: [PATCH] Updated members page, some UI and logic changes * Updated project details 2024 --- app/members/page.jsx | 33 ++--------------- app/projects/page.tsx | 63 ++++++++++++++++--------------- public/data/projects.json | 78 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 111 insertions(+), 63 deletions(-) diff --git a/app/members/page.jsx b/app/members/page.jsx index 1c276dc..b62e824 100644 --- a/app/members/page.jsx +++ b/app/members/page.jsx @@ -6,9 +6,10 @@ import MemberCard from '../../components/MemberCard' import LayoutAlt from '../../components/LayoutAlt' function Members() { - const [currentYear, setCurrentYear] = useState(2024) + const [showYears, setShowYears] = useState(false) const years = [2024, 2023, 2022, 2020, 2019, 2018, 2017, 2016, 2015] + const [currentYear, setCurrentYear] = useState(years.sort((a, b) => { b - a })[0]) const yearElementsMd = years.map((year, ind) => { return ( - - {showYears && ( -
- {years.map((year, ind) => ( - - ))} -
- )} -
diff --git a/app/projects/page.tsx b/app/projects/page.tsx index 0f6c356..3fcce0e 100644 --- a/app/projects/page.tsx +++ b/app/projects/page.tsx @@ -23,18 +23,17 @@ export default function NewProjects() { const [selectedId, setSelectedId] = useState(-1) const containerRefs = useRef(new Array()) - const [currentYear, setCurrentYear] = useState(2023) + const years = [2024, 2023, 2022, 2020, 2019, 2018, 2017, 2016] - const years = [2023, 2022, 2020, 2019, 2018, 2017, 2016] + const [currentYear, setCurrentYear] = useState(years.sort((a, b) => { return b - a })[0]) const yearElements = years.map((year, ind) => { return ( @@ -53,7 +52,7 @@ export default function NewProjects() { // const FlattenedAllProjects = AllProjects.flat(1); const cardLayout = ( -
+
{currentProjects.map((card, i) => { return ( { - e.stopPropagation() - setSelectedId( - (prev) => - prev + 1 - ) - }} - > - { + e.stopPropagation() + setSelectedId( + (prev) => + prev + 1 + ) + }} > - - - - )} + + + + + )}