From 3abb114d854001423fe0f69c653696a18c95c8f6 Mon Sep 17 00:00:00 2001 From: wu-ada Date: Mon, 19 Feb 2024 16:32:29 -0500 Subject: [PATCH 01/11] created footer --- src/app/public/layout.tsx | 4 +- src/app/public/page.tsx | 273 +++++++++++++++---------------- src/components/Layout/Footer.tsx | 13 ++ src/components/Layout/index.tsx | 1 + 4 files changed, 152 insertions(+), 139 deletions(-) create mode 100644 src/components/Layout/Footer.tsx create mode 100644 src/components/Layout/index.tsx diff --git a/src/app/public/layout.tsx b/src/app/public/layout.tsx index 797c95b3..a6d6d3af 100644 --- a/src/app/public/layout.tsx +++ b/src/app/public/layout.tsx @@ -1,4 +1,5 @@ import Navbar from "@components/Navbar"; +import { Footer } from "@components/Layout"; interface IPublicLayout { children: React.ReactNode; @@ -8,7 +9,8 @@ const PublicLayout = ({ children }: IPublicLayout) => { return ( <> - {children} +
{children}
+
); }; diff --git a/src/app/public/page.tsx b/src/app/public/page.tsx index deec8fb6..d62ed7d9 100644 --- a/src/app/public/page.tsx +++ b/src/app/public/page.tsx @@ -16,153 +16,150 @@ const HomePage = () => { "https://drive.google.com/drive/folders/1vw8rc5sU0bYJkgH75VZOjI6IF-XAWEmG?usp=share_link"; const legacyInstagram = "https://instagram.com/thelegacyprojectus?igshid=MzRlODBiNWFlZA=="; + //
+ // + // {/* Hero Section and Action Items Buttons */} + //
+ //
+ //

+ // Everyone has a story that's worth preserving. + //

+ //

+ // The Legacy Project, Inc. (TLP) connects college students with + // local elders in their community with the purpose of building + // strong intergenerational relationships and documenting the life + // histories of seniors, ensuring that their legacies are preserved + // for years to come. + //

- return ( - <> -
- - {/* Hero Section and Action Items Buttons */} -
-
-

- Everyone has a story that's worth preserving. -

-

- The Legacy Project, Inc. (TLP) connects college students with - local elders in their community with the purpose of building - strong intergenerational relationships and documenting the life - histories of seniors, ensuring that their legacies are preserved - for years to come. -

+ //

+ // Join an ever-growing network of college students across the + // country passionate about telling stories, and form a Legacy + // Project chapter at your school or university today. Fill out the + // form below and we will be in touch soon about next steps! + //

+ //
-

- Join an ever-growing network of college students across the - country passionate about telling stories, and form a Legacy - Project chapter at your school or university today. Fill out the - form below and we will be in touch soon about next steps! -

-
+ // + // A drawing of an older woman and a young boy enjoying ice cream cones together. + // + //
+ // {/* Action Items Buttons */} - - A drawing of an older woman and a young boy enjoying ice cream cones together. - -
- {/* Action Items Buttons */} + //
+ //

+ //

-
-

-

+ //
+ // + //
+ // + // About Us + // + //

+ // The concept of The Legacy Project (TLP) began in 2018, when Arielle + // Galinsky, a high school junior at the time, spent her time working + // at a local senior community in her Massachusetts hometown. Her role + // allowed her to interact with the residents, which she greatly + // enjoyed, yet she always left her shift with a strong desire to learn + // more about the stories of the seniors she met. With this strong + // curiosity, paired with a deep sense of regret she felt having lost + // her own grandfathers at a young age, Arielle decided to spearhead + // TLP as a personal project. The initiative encompassed conducting + // thorough interviews of 18 residents living in the community, with + // the intention to hold a ceremony at the finale of the project to + // provide her older friends with the opportunity to share their + // stories with their families. When the COVID-19 pandemic hit, Arielle + // pivoted, and decided the best way to preserve the 18 captivating + // stories of the seniors she interviewed was through prose. Arielle + // published Their Lives Reflected: A Treasury of Life Stories Captured + // Through The Legacy Project in 2021 to showcase and celebrate their + // life accounts, both for the seniors themselves and their families. + //

-
- -
- - About Us - -

- The concept of The Legacy Project (TLP) began in 2018, when Arielle - Galinsky, a high school junior at the time, spent her time working - at a local senior community in her Massachusetts hometown. Her role - allowed her to interact with the residents, which she greatly - enjoyed, yet she always left her shift with a strong desire to learn - more about the stories of the seniors she met. With this strong - curiosity, paired with a deep sense of regret she felt having lost - her own grandfathers at a young age, Arielle decided to spearhead - TLP as a personal project. The initiative encompassed conducting - thorough interviews of 18 residents living in the community, with - the intention to hold a ceremony at the finale of the project to - provide her older friends with the opportunity to share their - stories with their families. When the COVID-19 pandemic hit, Arielle - pivoted, and decided the best way to preserve the 18 captivating - stories of the seniors she interviewed was through prose. Arielle - published Their Lives Reflected: A Treasury of Life Stories Captured - Through The Legacy Project in 2021 to showcase and celebrate their - life accounts, both for the seniors themselves and their families. -

+ //

+ // Little did she know that, in the state right next over, Katie Furey, + // a sophomore in college home for the pandemic, started a similar + // project of her own. Katie had always been close with her + // grandmother, Mary, who was living in a nursing home at the time of + // the pandemic. When Katie and her family would visit Mary and her + // neighbors from outside the window of the nursing home, waving + // frantically through the glass and chatting on the phone, Katie + // wished there was a way for young people like herself to connect more + // deeply with these wonderful people on the other side of the glass + // who were experiencing a loneliness perhaps even more pronounced than + // the loneliness Katie and her peers were facing as the pandemic + // ramped up. The United Nations Millennium Fellowship being hosted + // through Tufts University presented a perfect opportunity for Katie + // to put her idea into action. Using the program’s framework, Katie + // partnered with the Little Sisters of the Poor home in Enfield, + // Connecticut. Katie met around ten older adults from the home on + // Zoom, connecting with them and learning tidbits of their life + // stories, which she is working on compiling as a series of vignettes. + //

-

- Little did she know that, in the state right next over, Katie Furey, - a sophomore in college home for the pandemic, started a similar - project of her own. Katie had always been close with her - grandmother, Mary, who was living in a nursing home at the time of - the pandemic. When Katie and her family would visit Mary and her - neighbors from outside the window of the nursing home, waving - frantically through the glass and chatting on the phone, Katie - wished there was a way for young people like herself to connect more - deeply with these wonderful people on the other side of the glass - who were experiencing a loneliness perhaps even more pronounced than - the loneliness Katie and her peers were facing as the pandemic - ramped up. The United Nations Millennium Fellowship being hosted - through Tufts University presented a perfect opportunity for Katie - to put her idea into action. Using the program’s framework, Katie - partnered with the Little Sisters of the Poor home in Enfield, - Connecticut. Katie met around ten older adults from the home on - Zoom, connecting with them and learning tidbits of their life - stories, which she is working on compiling as a series of vignettes. -

+ //
+ //

+ // Arielle and Katie met in 2020, quickly connecting over their + // aligned passions to build intergenerational connections provide a + // platform for local seniors to share their stories, and preserve + // such histories through their collective love for writing. They + // decided to start the Tufts Legacy Project, a chapter of The Legacy + // Project based out of Tufts University in Medford, Massachusetts + // which seeks to bond college students 1:1 with older adults living + // in the host communities of Medford and Somerville. When Katie + // decided to join the Millennium Fellowship for a second year, she + // met Wanda Schlumpf, a sophomore at Tufts, who was similarly + // dedicated to the value of storytelling. Wanda took on the project + // with her and joined the Tufts TLP chapter as a founding member. + // Together, the three women helped to build it into an organization + // of nearly 30 students passionate about empowering local seniors + // with the platform to amplify their stories. + //

-
-

- Arielle and Katie met in 2020, quickly connecting over their - aligned passions to build intergenerational connections provide a - platform for local seniors to share their stories, and preserve - such histories through their collective love for writing. They - decided to start the Tufts Legacy Project, a chapter of The Legacy - Project based out of Tufts University in Medford, Massachusetts - which seeks to bond college students 1:1 with older adults living - in the host communities of Medford and Somerville. When Katie - decided to join the Millennium Fellowship for a second year, she - met Wanda Schlumpf, a sophomore at Tufts, who was similarly - dedicated to the value of storytelling. Wanda took on the project - with her and joined the Tufts TLP chapter as a founding member. - Together, the three women helped to build it into an organization - of nearly 30 students passionate about empowering local seniors - with the platform to amplify their stories. -

+ //

+ // Having watched the Tufts chapter grow over the past two years, + // Arielle, Katie, and Wanda decided to establish TLP as a nonprofit + // organization with the goal of spreading TLP’s mission across the + // country - preserving stories of seniors who might not otherwise + // have the opportunity. TLP seeks to build sustainable, + // intergenerational connections as a means to combat social + // isolation, preserve the life histories of older adults, engage + // young individuals in revolutionizing perspectives on aging, and + // ensure that every old adult- regardless of background - has the + // opportunity to share their experiences. + //

+ //
+ //
-

- Having watched the Tufts chapter grow over the past two years, - Arielle, Katie, and Wanda decided to establish TLP as a nonprofit - organization with the goal of spreading TLP’s mission across the - country - preserving stories of seniors who might not otherwise - have the opportunity. TLP seeks to build sustainable, - intergenerational connections as a means to combat social - isolation, preserve the life histories of older adults, engage - young individuals in revolutionizing perspectives on aging, and - ensure that every old adult- regardless of background - has the - opportunity to share their experiences. -

-
-
+ // + // + //
- - - - - ); + return <>hi; }; HomePage.displayName = "public"; diff --git a/src/components/Layout/Footer.tsx b/src/components/Layout/Footer.tsx new file mode 100644 index 00000000..782fc4d8 --- /dev/null +++ b/src/components/Layout/Footer.tsx @@ -0,0 +1,13 @@ +import React from "react"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faInstagram } from "@fortawesome/free-brands-svg-icons"; + +const Footer = () => { + return ( +
+ +
+ ); +}; + +export default Footer; diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx new file mode 100644 index 00000000..090a49ac --- /dev/null +++ b/src/components/Layout/index.tsx @@ -0,0 +1 @@ +export { default as Footer } from "./Footer"; From 14e193e0c1e69257a2a8b0c4ba0846e45acaafa4 Mon Sep 17 00:00:00 2001 From: nickbar01234 Date: Mon, 19 Feb 2024 16:59:02 -0500 Subject: [PATCH 02/11] Add Footer Co-authored-by: wu-ada --- src/components/Layout/Footer.tsx | 16 ++++++++++++++-- src/components/ResourceTile.tsx | 1 - 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/Layout/Footer.tsx b/src/components/Layout/Footer.tsx index 782fc4d8..c2267f67 100644 --- a/src/components/Layout/Footer.tsx +++ b/src/components/Layout/Footer.tsx @@ -1,11 +1,23 @@ import React from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faInstagram } from "@fortawesome/free-brands-svg-icons"; +import Link from "next/link"; + +const INSTAGRAM_URL = + "https://instagram.com/thelegacyprojectus?igshid=MzRlODBiNWFlZA=="; const Footer = () => { return ( -
- + ); }; diff --git a/src/components/ResourceTile.tsx b/src/components/ResourceTile.tsx index d79b1652..b18b434b 100644 --- a/src/components/ResourceTile.tsx +++ b/src/components/ResourceTile.tsx @@ -6,7 +6,6 @@ import { faArrowUpRightFromSquare, faTrashCan, } from "@fortawesome/free-solid-svg-icons"; -import Link from "next/link"; interface IResourceProp { resource: Resource; From cee4bc9be1c3d64168ce9076f3038195e538c479 Mon Sep 17 00:00:00 2001 From: nickbar01234 Date: Thu, 22 Feb 2024 18:10:22 -0500 Subject: [PATCH 03/11] Work on landing page --- src/app/public/layout.tsx | 10 +- src/app/public/page.tsx | 229 ++++++++++++------------------- src/components/FlowerBox.tsx | 14 +- src/components/Layout/Footer.tsx | 4 +- 4 files changed, 106 insertions(+), 151 deletions(-) diff --git a/src/app/public/layout.tsx b/src/app/public/layout.tsx index a6d6d3af..9dcc6b28 100644 --- a/src/app/public/layout.tsx +++ b/src/app/public/layout.tsx @@ -7,11 +7,13 @@ interface IPublicLayout { const PublicLayout = ({ children }: IPublicLayout) => { return ( - <> - -
{children}
+
+
+ +
{children}
+
- +
); }; diff --git a/src/app/public/page.tsx b/src/app/public/page.tsx index d62ed7d9..0a6a39dd 100644 --- a/src/app/public/page.tsx +++ b/src/app/public/page.tsx @@ -16,150 +16,103 @@ const HomePage = () => { "https://drive.google.com/drive/folders/1vw8rc5sU0bYJkgH75VZOjI6IF-XAWEmG?usp=share_link"; const legacyInstagram = "https://instagram.com/thelegacyprojectus?igshid=MzRlODBiNWFlZA=="; - //
- // - // {/* Hero Section and Action Items Buttons */} - //
- //
- //

- // Everyone has a story that's worth preserving. - //

- //

- // The Legacy Project, Inc. (TLP) connects college students with - // local elders in their community with the purpose of building - // strong intergenerational relationships and documenting the life - // histories of seniors, ensuring that their legacies are preserved - // for years to come. - //

- //

- // Join an ever-growing network of college students across the - // country passionate about telling stories, and form a Legacy - // Project chapter at your school or university today. Fill out the - // form below and we will be in touch soon about next steps! - //

- //
+ return ( +
+ + {/* Hero Section and Action Items Buttons */} +
+
+

+ Everyone has a story that's worth preserving. +

+

+ The Legacy Project, Inc. (TLP) connects college students with + local elders in their community with the purpose of building + strong intergenerational relationships and documenting the life + histories of seniors, ensuring that their legacies are preserved + for years to come. +

- // - // A drawing of an older woman and a young boy enjoying ice cream cones together. - // - //
- // {/* Action Items Buttons */} +

+ Join an ever-growing network of college students across the + country passionate about telling stories, and form a Legacy + Project chapter at your school or university today. Fill out the + form below and we will be in touch soon about next steps! +

+
- //
- //

- //

+ + A drawing of an older woman and a young boy enjoying ice cream cones together. + +
+ {/* Action Items Buttons */} - //
- //
- //
- // - // About Us - // - //

- // The concept of The Legacy Project (TLP) began in 2018, when Arielle - // Galinsky, a high school junior at the time, spent her time working - // at a local senior community in her Massachusetts hometown. Her role - // allowed her to interact with the residents, which she greatly - // enjoyed, yet she always left her shift with a strong desire to learn - // more about the stories of the seniors she met. With this strong - // curiosity, paired with a deep sense of regret she felt having lost - // her own grandfathers at a young age, Arielle decided to spearhead - // TLP as a personal project. The initiative encompassed conducting - // thorough interviews of 18 residents living in the community, with - // the intention to hold a ceremony at the finale of the project to - // provide her older friends with the opportunity to share their - // stories with their families. When the COVID-19 pandemic hit, Arielle - // pivoted, and decided the best way to preserve the 18 captivating - // stories of the seniors she interviewed was through prose. Arielle - // published Their Lives Reflected: A Treasury of Life Stories Captured - // Through The Legacy Project in 2021 to showcase and celebrate their - // life accounts, both for the seniors themselves and their families. - //

+
+

+

- //

- // Little did she know that, in the state right next over, Katie Furey, - // a sophomore in college home for the pandemic, started a similar - // project of her own. Katie had always been close with her - // grandmother, Mary, who was living in a nursing home at the time of - // the pandemic. When Katie and her family would visit Mary and her - // neighbors from outside the window of the nursing home, waving - // frantically through the glass and chatting on the phone, Katie - // wished there was a way for young people like herself to connect more - // deeply with these wonderful people on the other side of the glass - // who were experiencing a loneliness perhaps even more pronounced than - // the loneliness Katie and her peers were facing as the pandemic - // ramped up. The United Nations Millennium Fellowship being hosted - // through Tufts University presented a perfect opportunity for Katie - // to put her idea into action. Using the program’s framework, Katie - // partnered with the Little Sisters of the Poor home in Enfield, - // Connecticut. Katie met around ten older adults from the home on - // Zoom, connecting with them and learning tidbits of their life - // stories, which she is working on compiling as a series of vignettes. - //

+
+ +
+ + About Us + +

+ The Legacy Project, Inc. (TLP) connects college students with local + elders in their community with the purpose of building strong + intergenerational relationships and documenting the life histories of + seniors, ensuring that their legacies are preserved for years to come. + Join an ever-growing network of college students across the country + passionate about telling stories, and form a Legacy Project chapter at + your school today. +

+

+ The concept of The Legacy Project (TLP) began in 2018, when Arielle + Galinsky, a high school junior at the time, spent her time working at + a local senior community in her Massachusetts hometown. Her role + allowed her to interact with the residents, which she greatly enjoyed, + yet she always left her shift with a strong desire to learn more about + the stories of the seniors she met. With this strong curiosity, paired + with a deep sense of regret she felt having lost her own grandfathers + at a young age, Arielle decided to spearhead TLP as a personal + project. The initiative encompassed conducting thorough interviews of + 18 residents living in the community, with the intention to hold a + ceremony at the finale of the project to provide her older friends + with the opportunity to share their stories with their families. When + the COVID-19 pandemic hit, Arielle pivoted, and decided the best way + to preserve the 18 captivating stories of the seniors she interviewed + was through prose. +

+
- //
- //

- // Arielle and Katie met in 2020, quickly connecting over their - // aligned passions to build intergenerational connections provide a - // platform for local seniors to share their stories, and preserve - // such histories through their collective love for writing. They - // decided to start the Tufts Legacy Project, a chapter of The Legacy - // Project based out of Tufts University in Medford, Massachusetts - // which seeks to bond college students 1:1 with older adults living - // in the host communities of Medford and Somerville. When Katie - // decided to join the Millennium Fellowship for a second year, she - // met Wanda Schlumpf, a sophomore at Tufts, who was similarly - // dedicated to the value of storytelling. Wanda took on the project - // with her and joined the Tufts TLP chapter as a founding member. - // Together, the three women helped to build it into an organization - // of nearly 30 students passionate about empowering local seniors - // with the platform to amplify their stories. - //

- - //

- // Having watched the Tufts chapter grow over the past two years, - // Arielle, Katie, and Wanda decided to establish TLP as a nonprofit - // organization with the goal of spreading TLP’s mission across the - // country - preserving stories of seniors who might not otherwise - // have the opportunity. TLP seeks to build sustainable, - // intergenerational connections as a means to combat social - // isolation, preserve the life histories of older adults, engage - // young individuals in revolutionizing perspectives on aging, and - // ensure that every old adult- regardless of background - has the - // opportunity to share their experiences. - //

- //
- //
- - // - // - //
- - return <>hi; + + + + ); }; HomePage.displayName = "public"; diff --git a/src/components/FlowerBox.tsx b/src/components/FlowerBox.tsx index e5e7dcc1..23497cf8 100644 --- a/src/components/FlowerBox.tsx +++ b/src/components/FlowerBox.tsx @@ -7,12 +7,12 @@ interface FlowerBoxProps { const FlowerBox = ({ children }: FlowerBoxProps) => { return (
- {children} + {children} - + { alt="Pink flower top left frame" /> - + { alt="Pink flower bottom left frame" /> - + { alt="Pink flower top right frame" /> - + { return ( - +
); }; From c0574675897df9af79c69203936d689fe90aedc4 Mon Sep 17 00:00:00 2001 From: wu-ada Date: Sun, 3 Mar 2024 17:19:37 -0500 Subject: [PATCH 04/11] Finished landing footer. Started on formatting for 'Everyone has a story page' Co-authored-by: Nick Doan --- src/app/public/page.tsx | 105 +++++++++++++++++-------------- src/components/FlowerBox.tsx | 8 +-- src/components/LandingFooter.tsx | 93 +++++++++++++-------------- src/components/Layout/Footer.tsx | 3 +- 4 files changed, 108 insertions(+), 101 deletions(-) diff --git a/src/app/public/page.tsx b/src/app/public/page.tsx index 0a6a39dd..98ef8bcf 100644 --- a/src/app/public/page.tsx +++ b/src/app/public/page.tsx @@ -8,6 +8,8 @@ import FlowerBox from "@components/FlowerBox"; import Button from "@components/Button"; import Image from "next/legacy/image"; +import Link from "next/link"; +import Logo from "@public/icons/logo.svg"; const HomePage = () => { // TODO: make env variables @@ -16,67 +18,45 @@ const HomePage = () => { "https://drive.google.com/drive/folders/1vw8rc5sU0bYJkgH75VZOjI6IF-XAWEmG?usp=share_link"; const legacyInstagram = "https://instagram.com/thelegacyprojectus?igshid=MzRlODBiNWFlZA=="; + const MEET_TLP = "/public/team/"; + const READ_MORE = "/public/about/"; return (
- +
{/* Hero Section and Action Items Buttons */} -
-
-

+
+
+

Everyone has a story that's worth preserving.

-

- The Legacy Project, Inc. (TLP) connects college students with - local elders in their community with the purpose of building - strong intergenerational relationships and documenting the life - histories of seniors, ensuring that their legacies are preserved - for years to come. -

- -

- Join an ever-growing network of college students across the - country passionate about telling stories, and form a Legacy - Project chapter at your school or university today. Fill out the - form below and we will be in touch soon about next steps! +

+ The Legacy Project documents the stories of the elder generation + to ensure that their legacies are preserved for years to come.

- - + {/* A drawing of an older woman and a young boy enjoying ice cream cones together. - + */}
{/* Action Items Buttons */} -

- -
- +

About Us @@ -86,21 +66,45 @@ const HomePage = () => { elders in their community with the purpose of building strong intergenerational relationships and documenting the life histories of seniors, ensuring that their legacies are preserved for years to come. +

+ +

Join an ever-growing network of college students across the country passionate about telling stories, and form a Legacy Project chapter at your school today.

+
+ + Meet TLP + +
+ + Our Story +

- The concept of The Legacy Project (TLP) began in 2018, when Arielle - Galinsky, a high school junior at the time, spent her time working at - a local senior community in her Massachusetts hometown. Her role - allowed her to interact with the residents, which she greatly enjoyed, - yet she always left her shift with a strong desire to learn more about - the stories of the seniors she met. With this strong curiosity, paired + The concept of{" "} + + The Legacy Project (TLP) + {" "} + began in 2018, when{" "} + Arielle Galinsky, a + high school junior at the time, spent her time working at a local + senior community in her Massachusetts hometown. Her role allowed her + to interact with the residents, which she greatly enjoyed, yet she + always left her shift with a strong desire to learn more about the + stories of the seniors she met. With this strong curiosity, paired with a deep sense of regret she felt having lost her own grandfathers - at a young age, Arielle decided to spearhead TLP as a personal - project. The initiative encompassed conducting thorough interviews of - 18 residents living in the community, with the intention to hold a + at a young age, Arielle decided to spearhead{" "} + TLP as a personal + project. +

+ +

+ The initiative encompassed conducting thorough interviews of 18 + residents living in the community, with the intention to hold a ceremony at the finale of the project to provide her older friends with the opportunity to share their stories with their families. When the COVID-19 pandemic hit, Arielle pivoted, and decided the best way @@ -108,7 +112,14 @@ const HomePage = () => { was through prose.

- +
diff --git a/src/components/FlowerBox.tsx b/src/components/FlowerBox.tsx index 23497cf8..e4a21bb4 100644 --- a/src/components/FlowerBox.tsx +++ b/src/components/FlowerBox.tsx @@ -7,12 +7,12 @@ interface FlowerBoxProps { const FlowerBox = ({ children }: FlowerBoxProps) => { return (
{children} - + {/* { objectFit="cover" alt="Pink flower bottom right frame" /> - + */}
); }; diff --git a/src/components/LandingFooter.tsx b/src/components/LandingFooter.tsx index 44e7864f..6c8d319e 100644 --- a/src/components/LandingFooter.tsx +++ b/src/components/LandingFooter.tsx @@ -7,14 +7,14 @@ const LandingFooter = () => { const [email, setEmail] = useState(""); const [eList, setEList] = useState>(new Set()); - const [buttonText, setButtonText] = useState("Join Us"); + const [buttonText, setButtonText] = useState("Join E-List"); const [buttonStyle, setButtonStyle] = useState( - "bg-teal hover:bg-dark-teal hover:-translate-y-0.5" + "bg-dark-teal hover:-translate-y-0.5" ); function resetButton(target: FocusEvent) { - setButtonStyle("bg-teal hover:bg-dark-teal hover:-translate-y-0.5"); - setButtonText("Join Us"); + setButtonStyle("bg-dark-teal hover:-translate-y-0.5"); + setButtonText("Join E-List"); } const onEmailSubmit = async (event: FormEvent) => { @@ -35,66 +35,63 @@ const LandingFooter = () => { const responseObject = EmailResponse.parse(await res.json()); if (responseObject.code == "INVALID_EMAIL") { setButtonText("Invalid Email"); - setButtonStyle("bg-light-rust"); // no hover + setButtonStyle("bg-tag-rust"); // no hover return; } else if (responseObject.code == "DUPLICATE_EMAIL") { setButtonText("Duplicate Email"); - setButtonStyle("bg-light-rust"); // no hover + setButtonStyle("bg-tag-rust"); // no hover return; } setButtonText("Subscribed!"); - setButtonStyle("bg-light-teal"); // no hover + setButtonStyle("bg-dark-teal"); // no hover } else { setButtonText("Invalid Email"); - setButtonStyle("bg-light-rust"); // no hover + setButtonStyle("bg-tag-rust"); // no hover } }; return ( -
- -

- There are millions of stories waiting to be told. It's your - moment to change that. +

+
+

There are millions of stories waiting to be told.

+

It's your moment to change that.

+
+
+

+ Join an ever-growing network of college students across the country + passionate about preserving generational legacies.

-

- Leave a lasting legacy on your college or university campus by - founding a chapter of The Legacy Project at your school today. Reach - us at{" "} - - exec@thelegacyproject.org. - +

+ Sign up for our E-List to stay up to date on what The Legacy Project + is doing:

-
+ + { + setEmail(event.target.value); + }} + /> + -
- + + {buttonText} + + +
); }; diff --git a/src/components/Layout/Footer.tsx b/src/components/Layout/Footer.tsx index 87ac4465..12bcc88d 100644 --- a/src/components/Layout/Footer.tsx +++ b/src/components/Layout/Footer.tsx @@ -1,7 +1,6 @@ import React from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faInstagram } from "@fortawesome/free-brands-svg-icons"; -import Link from "next/link"; const INSTAGRAM_URL = "https://instagram.com/thelegacyprojectus?igshid=MzRlODBiNWFlZA=="; @@ -16,7 +15,7 @@ const Footer = () => { className="flex items-center space-x-1.5" > -
tuftslegacyproject
+
tuftslegacyproject
); From 0b300708dfbbfb465d2ef7982e1d1179fc798afc Mon Sep 17 00:00:00 2001 From: wu-ada Date: Fri, 8 Mar 2024 03:04:01 -0500 Subject: [PATCH 05/11] Finished styling for first box of landing page. Matched padding for most elements on page. Added tan background. Added Logo to first box but experiencing extra space on top Co-authored-by: Nick Doan --- src/app/layout.tsx | 2 +- src/app/public/page.tsx | 47 +++++++--------------- src/components/LandingFooter.tsx | 3 +- src/components/PhotoCarousel.tsx | 68 ++++++++++++++++---------------- 4 files changed, 51 insertions(+), 69 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index d1f026e0..d83f9a80 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -39,7 +39,7 @@ const RootLayout = async ({ children }: IRootLayout) => { {children} diff --git a/src/app/public/page.tsx b/src/app/public/page.tsx index 98ef8bcf..eff4ab3b 100644 --- a/src/app/public/page.tsx +++ b/src/app/public/page.tsx @@ -4,7 +4,6 @@ import Head from "next/head"; import PhotoCarousel from "@components/PhotoCarousel"; import LandingFooter from "@components/LandingFooter"; -import FlowerBox from "@components/FlowerBox"; import Button from "@components/Button"; import Image from "next/legacy/image"; @@ -19,12 +18,15 @@ const HomePage = () => { const legacyInstagram = "https://instagram.com/thelegacyprojectus?igshid=MzRlODBiNWFlZA=="; const MEET_TLP = "/public/team/"; - const READ_MORE = "/public/about/"; + const START_A_CHAPTER = "/public/start-chapter"; return (
-
+
{/* Hero Section and Action Items Buttons */} +
+ logo +

@@ -35,29 +37,18 @@ const HomePage = () => { to ensure that their legacies are preserved for years to come.

- {/* - A drawing of an older woman and a young boy enjoying ice cream cones together. - */}
{/* Action Items Buttons */} -
-

-

+
+ + Start A Chapter +
-
+
About Us @@ -73,6 +64,7 @@ const HomePage = () => { passionate about telling stories, and form a Legacy Project chapter at your school today.

+
{ Meet TLP
- + Our Story

@@ -112,15 +104,6 @@ const HomePage = () => { was through prose.

- -
); diff --git a/src/components/LandingFooter.tsx b/src/components/LandingFooter.tsx index 6c8d319e..2bab4cd1 100644 --- a/src/components/LandingFooter.tsx +++ b/src/components/LandingFooter.tsx @@ -1,6 +1,5 @@ "use client"; import React, { FormEvent, FocusEvent, useState } from "react"; -import FlowerBox from "@components/FlowerBox"; import { EmailResponse } from "@api/emails/route.schema"; const LandingFooter = () => { @@ -55,7 +54,7 @@ const LandingFooter = () => {

There are millions of stories waiting to be told.

-

It's your moment to change that.

+

It's your time to change that.

diff --git a/src/components/PhotoCarousel.tsx b/src/components/PhotoCarousel.tsx index e0e7b8d3..d4212c6c 100644 --- a/src/components/PhotoCarousel.tsx +++ b/src/components/PhotoCarousel.tsx @@ -6,24 +6,27 @@ type PhotoProps = { caption: string; }; - const PhotoCarousel = () => { const [photos, setPhotos] = useState([]); const [activeIndex, setActiveIndex] = useState(0); const [show, setShow] = useState(1); const widthRef = useRef(null); - + const [elemWidth, setElemWidth] = useState(0); - + useEffect(() => { - function handleResize() { + function handleResize() { setElemWidth(widthRef.current ? widthRef.current.offsetWidth : 0); - const showVal = widthRef.current ? Math.floor(widthRef.current.offsetWidth / 250) : 1; + const showVal = widthRef.current + ? Math.floor(widthRef.current.offsetWidth / 250) + : 1; setShow(showVal || 1); } window.addEventListener("resize", handleResize); handleResize(); - return () => { window.removeEventListener("resize", handleResize) } + return () => { + window.removeEventListener("resize", handleResize); + }; }, []); const carouselHeight = elemWidth / show; @@ -40,7 +43,7 @@ const PhotoCarousel = () => { { filePath: "/gallery/Tufts Legacy-255.jpg", caption: "picture3" }, { filePath: "/gallery/Tufts Legacy-258.jpg", caption: "picture4" }, ]); - }, []); + }, []); const nextIndex = () => { setActiveIndex(activeIndex === show - 1 ? 0 : activeIndex - 1); @@ -51,8 +54,7 @@ const PhotoCarousel = () => { }; return ( -

+
{/* photo carousel */}
{
- { - photos.map( - (photo, index) => - ( -
- {photo.caption} -
- ) - )} + {photos.map((photo, index) => ( +
+ {photo.caption} +
+ ))}
Date: Fri, 8 Mar 2024 14:50:32 -0500 Subject: [PATCH 06/11] Deleted font-serif to allow new auto font --- src/app/public/page.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/public/page.tsx b/src/app/public/page.tsx index eff4ab3b..4a04ba37 100644 --- a/src/app/public/page.tsx +++ b/src/app/public/page.tsx @@ -29,10 +29,10 @@ const HomePage = () => {
-

+

Everyone has a story that's worth preserving.

-

+

The Legacy Project documents the stories of the elder generation to ensure that their legacies are preserved for years to come.

@@ -49,17 +49,17 @@ const HomePage = () => {
- + About Us -

+

The Legacy Project, Inc. (TLP) connects college students with local elders in their community with the purpose of building strong intergenerational relationships and documenting the life histories of seniors, ensuring that their legacies are preserved for years to come.

-

+

Join an ever-growing network of college students across the country passionate about telling stories, and form a Legacy Project chapter at your school today. @@ -73,10 +73,10 @@ const HomePage = () => { Meet TLP

- + Our Story -

+

The concept of{" "} The Legacy Project (TLP) @@ -94,7 +94,7 @@ const HomePage = () => { project.

-

+

The initiative encompassed conducting thorough interviews of 18 residents living in the community, with the intention to hold a ceremony at the finale of the project to provide her older friends From 320c038048c6be4a4b6034b6f288ba5652cd20d6 Mon Sep 17 00:00:00 2001 From: wu-ada Date: Sat, 9 Mar 2024 20:05:58 -0500 Subject: [PATCH 07/11] added team page. moved LandingFooter into public layout --- src/app/public/layout.tsx | 5 ++++- src/app/public/page.tsx | 6 ++---- src/app/public/team/page.tsx | 26 ++++++++++++++++++++++++++ src/components/LandingFooter.tsx | 12 ++++++------ 4 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 src/app/public/team/page.tsx diff --git a/src/app/public/layout.tsx b/src/app/public/layout.tsx index 9dcc6b28..80c1c757 100644 --- a/src/app/public/layout.tsx +++ b/src/app/public/layout.tsx @@ -1,5 +1,6 @@ import Navbar from "@components/Navbar"; import { Footer } from "@components/Layout"; +import LandingFooter from "@components/LandingFooter"; interface IPublicLayout { children: React.ReactNode; @@ -10,7 +11,9 @@ const PublicLayout = ({ children }: IPublicLayout) => {

-
{children}
+
+ {children} +
diff --git a/src/app/public/page.tsx b/src/app/public/page.tsx index 4a04ba37..36a13537 100644 --- a/src/app/public/page.tsx +++ b/src/app/public/page.tsx @@ -3,7 +3,6 @@ import Head from "next/head"; import PhotoCarousel from "@components/PhotoCarousel"; -import LandingFooter from "@components/LandingFooter"; import Button from "@components/Button"; import Image from "next/legacy/image"; @@ -41,7 +40,7 @@ const HomePage = () => { {/* Action Items Buttons */}
Start A Chapter @@ -67,7 +66,7 @@ const HomePage = () => {
Meet TLP @@ -104,7 +103,6 @@ const HomePage = () => { was through prose.

- ); }; diff --git a/src/app/public/team/page.tsx b/src/app/public/team/page.tsx new file mode 100644 index 00000000..941e6ce5 --- /dev/null +++ b/src/app/public/team/page.tsx @@ -0,0 +1,26 @@ +const PublicLayout = async () => { + return ( +
+ + Meet TLP + +

+ The Legacy Project, Inc. (TLP) connects college students with local + elders in their community with the purpose of building strong + intergenerational relationships and documenting the life histories of + seniors, ensuring that their legacies are preserved for years to come. + Join an ever-growing network of college students across the country + passionate about telling stories, and form a Legacy Project chapter at + your school today. +

+
+ + Our Team + + + Press + +
+ ); +}; +export default PublicLayout; diff --git a/src/components/LandingFooter.tsx b/src/components/LandingFooter.tsx index 2bab4cd1..069672d6 100644 --- a/src/components/LandingFooter.tsx +++ b/src/components/LandingFooter.tsx @@ -52,11 +52,11 @@ const LandingFooter = () => { return (
-
+

There are millions of stories waiting to be told.

It's your time to change that.

-
+

Join an ever-growing network of college students across the country passionate about preserving generational legacies. @@ -73,8 +73,8 @@ const LandingFooter = () => { autoComplete="off" > { }} /> From 5e1a5b905365ca82baef1aca74321eee8c12ee90 Mon Sep 17 00:00:00 2001 From: wu-ada Date: Sun, 10 Mar 2024 14:29:47 -0400 Subject: [PATCH 08/11] fixed line height and removed font responsiveness --- src/app/public/page.tsx | 2 +- src/components/LandingFooter.tsx | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/public/page.tsx b/src/app/public/page.tsx index 36a13537..db72b6cb 100644 --- a/src/app/public/page.tsx +++ b/src/app/public/page.tsx @@ -28,7 +28,7 @@ const HomePage = () => {

-

+

Everyone has a story that's worth preserving.

diff --git a/src/components/LandingFooter.tsx b/src/components/LandingFooter.tsx index 069672d6..2513de5e 100644 --- a/src/components/LandingFooter.tsx +++ b/src/components/LandingFooter.tsx @@ -52,11 +52,11 @@ const LandingFooter = () => { return (

-
+

There are millions of stories waiting to be told.

It's your time to change that.

-
+

Join an ever-growing network of college students across the country passionate about preserving generational legacies. @@ -74,7 +74,7 @@ const LandingFooter = () => { > { className={`${buttonStyle} w-auto rounded-2xl px-4 py-4 duration-150`} type="submit" > - - {buttonText} - + {buttonText}

From b7d205f0e731796f8c317023a59f1d1f27fce97f Mon Sep 17 00:00:00 2001 From: wu-ada Date: Wed, 13 Mar 2024 19:33:08 -0400 Subject: [PATCH 09/11] changed button radius --- src/app/public/page.tsx | 4 ++-- src/components/LandingFooter.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/public/page.tsx b/src/app/public/page.tsx index db72b6cb..8fd0bd38 100644 --- a/src/app/public/page.tsx +++ b/src/app/public/page.tsx @@ -40,7 +40,7 @@ const HomePage = () => { {/* Action Items Buttons */}
Start A Chapter @@ -66,7 +66,7 @@ const HomePage = () => {
Meet TLP diff --git a/src/components/LandingFooter.tsx b/src/components/LandingFooter.tsx index 2513de5e..ce30ed7d 100644 --- a/src/components/LandingFooter.tsx +++ b/src/components/LandingFooter.tsx @@ -73,8 +73,8 @@ const LandingFooter = () => { autoComplete="off" > { }} />
+ ); +}; + +export default UserHomePage; diff --git a/src/app/private/[uid]/chapter-leader/home/resources/page.tsx b/src/app/private/[uid]/chapter-leader/home/resources/page.tsx new file mode 100644 index 00000000..c173cd80 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/home/resources/page.tsx @@ -0,0 +1,17 @@ +import DisplayResources from "@components/DisplayResources"; +import { prisma } from "@server/db/client"; + +const ChapterLeaderResourcesPage = async () => { + const resources = await prisma.resource.findMany({ + where: { + access: { + has: "CHAPTER_LEADER", + }, + }, + }); + return ( + + ); +}; + +export default ChapterLeaderResourcesPage; diff --git a/src/app/private/[uid]/chapter-leader/layout.tsx b/src/app/private/[uid]/chapter-leader/layout.tsx new file mode 100644 index 00000000..abd0fe60 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/layout.tsx @@ -0,0 +1,59 @@ +"use client"; + +import Sidebar, { ISideBar } from "@components/Sidebar"; +import { CollapsableSidebarContainer } from "@components/container"; +import { + faHome, + faUser, + faUserGroup, + faUserPlus, +} from "@fortawesome/free-solid-svg-icons"; +import React, { useContext } from "react"; +import { UserContext } from "src/context/UserProvider"; + +interface IUserLayout { + children: React.ReactNode; +} + +const UserLayout = ({ children }: IUserLayout) => { + const { user } = useContext(UserContext); + const buttons: ISideBar["buttons"] = React.useMemo( + () => [ + { + name: "Home", + link: `/private/${user.id}/chapter-leader/home`, + icon: faHome, + }, + { + name: "Members", + link: `/private/${user.id}/chapter-leader/users`, + icon: faUserGroup, + }, + // @TODO(nickbar01234) - Fix icon + { + name: "Seniors", + link: `/private/${user.id}/chapter-leader/seniors`, + icon: faUserGroup, + }, + { + name: "Pending", + link: `/private/${user.id}/chapter-leader/pending`, + icon: faUserPlus, + }, + { + name: "Profile", + link: `/private/${user.id}/chapter-leader/edit-profile`, + icon: faUser, + }, + ], + [user.id] + ); + + return ( + + {children} + + ); +}; + +export default UserLayout; diff --git a/src/app/private/[uid]/chapter-leader/pending/PendingHomePage.tsx b/src/app/private/[uid]/chapter-leader/pending/PendingHomePage.tsx new file mode 100644 index 00000000..963bf477 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/pending/PendingHomePage.tsx @@ -0,0 +1,34 @@ +"use client"; + +import PendingCard from "@components/PendingCard"; +import { CardGrid } from "@components/container"; +import { User } from "@prisma/client"; + +type MembersHomePageProps = { + users: User[]; +}; + +const PendingHomePage = ({ users }: MembersHomePageProps) => { + return ( + <> +

+ {`Pending (${users.length})`} +

+ {users.length > 0 ? ( + { + return ( + + ); + })} + /> + ) : ( +

+ {"This chapter has no pending members."} +

+ )} + + ); +}; + +export default PendingHomePage; diff --git a/src/app/private/[uid]/chapter-leader/pending/layout.tsx b/src/app/private/[uid]/chapter-leader/pending/layout.tsx new file mode 100644 index 00000000..b52667ac --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/pending/layout.tsx @@ -0,0 +1,20 @@ +import { HeaderContainer } from "@components/container"; +import { faUserGroup } from "@fortawesome/free-solid-svg-icons"; + +interface LayoutProps { + children?: React.ReactNode; +} + +const Layout = (props: LayoutProps) => { + return ( + + {props.children} + + ); +}; + +export default Layout; diff --git a/src/app/private/[uid]/chapter-leader/pending/page.tsx b/src/app/private/[uid]/chapter-leader/pending/page.tsx new file mode 100644 index 00000000..42a97be7 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/pending/page.tsx @@ -0,0 +1,35 @@ +import React from "react"; +import { prisma } from "@server/db/client"; +import PendingHomePage from "./PendingHomePage"; +import { User } from "@prisma/client"; + +const PendingPage = async ({ params }: { params: { uid: string } }) => { + const user = await prisma.user.findFirstOrThrow({ + where: { + id: params.uid, + }, + }); + + const userRequests = await prisma.userRequest.findMany({ + where: { + chapterId: user.ChapterID ?? "", + approved: "PENDING", + }, + }); + + const users: User[] = []; + + for (let i = 0; i < userRequests.length; i++) { + const user = await prisma.user.findFirstOrThrow({ + where: { + id: userRequests[i]?.uid ?? "", + }, + }); + + users.push(user); + } + + return ; +}; + +export default PendingPage; diff --git a/src/app/private/[uid]/chapter-leader/seniors/[seniorId]/page.tsx b/src/app/private/[uid]/chapter-leader/seniors/[seniorId]/page.tsx new file mode 100644 index 00000000..fbbf5e77 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/seniors/[seniorId]/page.tsx @@ -0,0 +1,41 @@ +import PathNav from "@components/PathNav"; +import { DisplaySenior } from "@components/senior"; +import { prisma } from "@server/db/client"; +import { seniorFullName } from "@utils"; + +interface LayoutProps { + params: { + seniorId: string; + }; +} + +const Page = async ({ params }: LayoutProps) => { + const senior = await prisma.senior.findFirstOrThrow({ + where: { id: params.seniorId }, + include: { + Files: true, + chapter: { + include: { + students: true, + }, + }, + }, + }); + + return ( +
+ + +
+ ); +}; + +export default Page; diff --git a/src/app/private/[uid]/chapter-leader/seniors/layout.tsx b/src/app/private/[uid]/chapter-leader/seniors/layout.tsx new file mode 100644 index 00000000..67fe8f43 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/seniors/layout.tsx @@ -0,0 +1,16 @@ +import { HeaderContainer } from "@components/container"; +import { faUsers } from "@fortawesome/free-solid-svg-icons"; + +interface LayoutProps { + children?: React.ReactNode; +} + +const Layout = ({ children }: LayoutProps) => { + return ( + + {children} + + ); +}; + +export default Layout; diff --git a/src/app/private/[uid]/chapter-leader/seniors/page.tsx b/src/app/private/[uid]/chapter-leader/seniors/page.tsx new file mode 100644 index 00000000..5e89fb12 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/seniors/page.tsx @@ -0,0 +1,37 @@ +import React from "react"; +import { prisma } from "@server/db/client"; +import { SeniorView } from "@components/SeniorView"; + +const UserSeniorsPage = async ({ params }: { params: { uid: string } }) => { + const userUid = params.uid; + const user = await prisma.user.findUnique({ + where: { + id: userUid, + }, + }); + if (!user) { + return
User not found
; + } + + // Fetch the seniors too + const chapter = await prisma.chapter.findFirst({ + where: { + id: user.ChapterID ?? undefined, + }, + include: { + seniors: {}, + students: {}, + }, + }); + const seniors = chapter?.seniors ? chapter.seniors : []; + const students = chapter?.students ? chapter.students : []; + + return ( + <> +
Seniors {`(${seniors.length})`}
+ + + ); +}; + +export default UserSeniorsPage; diff --git a/src/app/private/[uid]/chapter-leader/users/MembersHomePage.tsx b/src/app/private/[uid]/chapter-leader/users/MembersHomePage.tsx new file mode 100644 index 00000000..f9dcf72c --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/users/MembersHomePage.tsx @@ -0,0 +1,44 @@ +"use client"; + +import { UserTile } from "@components/TileGrid"; +import SearchableContainer from "@components/SearchableContainer"; +import { User } from "@prisma/client"; + +type MembersHomePageProps = { + members: User[]; + user: User; +}; + +const MembersHomePage = ({ members, user }: MembersHomePageProps) => { + const displayMembers = (elem: User, index: number) => ( + + ); + + return ( + <> +

+ {`Members (${members.length})`} +

+ + This chapter has no members. + + } + search={(member: User, filter: string) => + (member.firstName + " " + member.lastName) + .toLowerCase() + .includes(filter.toLowerCase()) + } + /> + + ); +}; + +export default MembersHomePage; diff --git a/src/app/private/[uid]/chapter-leader/users/[userId]/page.tsx b/src/app/private/[uid]/chapter-leader/users/[userId]/page.tsx new file mode 100644 index 00000000..c2a3eb24 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/users/[userId]/page.tsx @@ -0,0 +1,35 @@ +import PathNav from "@components/PathNav"; +import SearchableContainer from "@components/SearchableContainer"; +import { prisma } from "@server/db/client"; +import { fullName } from "@utils"; + +interface PageProps { + params: { + userId: string; + }; +} + +const Page = async ({ params }: PageProps) => { + const { userId } = params; + const user = await prisma.user.findUniqueOrThrow({ + where: { + id: userId, + }, + include: { + Seniors: true, + }, + }); + + return ( +
+ +
+ ); +}; + +export default Page; diff --git a/src/app/private/[uid]/chapter-leader/users/layout.tsx b/src/app/private/[uid]/chapter-leader/users/layout.tsx new file mode 100644 index 00000000..b52667ac --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/users/layout.tsx @@ -0,0 +1,20 @@ +import { HeaderContainer } from "@components/container"; +import { faUserGroup } from "@fortawesome/free-solid-svg-icons"; + +interface LayoutProps { + children?: React.ReactNode; +} + +const Layout = (props: LayoutProps) => { + return ( + + {props.children} + + ); +}; + +export default Layout; diff --git a/src/app/private/[uid]/chapter-leader/users/page.tsx b/src/app/private/[uid]/chapter-leader/users/page.tsx new file mode 100644 index 00000000..1165f864 --- /dev/null +++ b/src/app/private/[uid]/chapter-leader/users/page.tsx @@ -0,0 +1,24 @@ +import React from "react"; +import { prisma } from "@server/db/client"; +import MembersHomePage from "./MembersHomePage"; + +const MembersPage = async ({ params }: { params: { uid: string } }) => { + const user = await prisma.user.findFirstOrThrow({ + where: { + id: params.uid, + }, + }); + + const chapter = await prisma.chapter.findFirstOrThrow({ + where: { + id: user.ChapterID ?? "", + }, + include: { + students: true, + }, + }); + + return ; +}; + +export default MembersPage; diff --git a/src/app/private/[uid]/layout.tsx b/src/app/private/[uid]/layout.tsx new file mode 100644 index 00000000..3fbc0d3d --- /dev/null +++ b/src/app/private/[uid]/layout.tsx @@ -0,0 +1,21 @@ +import UserProvider from "@context/UserProvider"; +import { prisma } from "@server/db/client"; + +interface IPrivateLayout { + children: React.ReactNode; + params: { + uid: string; + }; +} + +const PrivateLayout = async ({ children, params }: IPrivateLayout) => { + const user = await prisma.user.findFirstOrThrow({ + where: { id: params.uid }, + include: { + Chapter: true, + }, + }); + return {children}; +}; + +export default PrivateLayout; diff --git a/src/app/private/[uid]/user/home/layout.tsx b/src/app/private/[uid]/user/home/layout.tsx index 244e61a5..2fad7c32 100644 --- a/src/app/private/[uid]/user/home/layout.tsx +++ b/src/app/private/[uid]/user/home/layout.tsx @@ -25,13 +25,15 @@ const Layout = async ({ children, params, joinChapter }: LayoutProps) => { headerIcon={faHouse} showHorizontalLine={false} > - - {children} +
+ + {children} +
); } else { diff --git a/src/app/private/[uid]/user/home/page.tsx b/src/app/private/[uid]/user/home/page.tsx index e3f666f9..31e4d04f 100644 --- a/src/app/private/[uid]/user/home/page.tsx +++ b/src/app/private/[uid]/user/home/page.tsx @@ -26,7 +26,7 @@ const UserHomePage = async ({ params }: UserHomePageParams) => { return (
-
+
{chapter.chapterName}
{ dateCreated={chapter.dateCreated} /> - Executive Board -
- } + title={
Executive Board
} tiles={chapter.students .filter((user) => user.role == "CHAPTER_LEADER") .map((user) => ( diff --git a/src/app/private/[uid]/user/home/resources/page.tsx b/src/app/private/[uid]/user/home/resources/page.tsx new file mode 100644 index 00000000..0d8a562f --- /dev/null +++ b/src/app/private/[uid]/user/home/resources/page.tsx @@ -0,0 +1,17 @@ +import DisplayResources from "@components/DisplayResources"; +import { prisma } from "@server/db/client"; + +const UserResourcesPage = async () => { + const resources = await prisma.resource.findMany({ + where: { + access: { + isEmpty: true, + }, + }, + }); + return ( + + ); +}; + +export default UserResourcesPage; diff --git a/src/app/private/[uid]/user/layout.tsx b/src/app/private/[uid]/user/layout.tsx index 52a1cb8a..7277efa2 100644 --- a/src/app/private/[uid]/user/layout.tsx +++ b/src/app/private/[uid]/user/layout.tsx @@ -1,11 +1,7 @@ "use client"; -import Sidebar, { ISideBar } from "@components/Sidebar"; -import { - faHome, - faUsers, - faUser, -} from "@fortawesome/free-solid-svg-icons"; +import { CollapsableSidebarContainer } from "@components/container"; +import { faHome, faUsers, faUser } from "@fortawesome/free-solid-svg-icons"; import React, { useContext } from "react"; import { UserContext } from "src/context/UserProvider"; @@ -15,7 +11,7 @@ interface IUserLayout { const UserLayout = ({ children }: IUserLayout) => { const { user } = useContext(UserContext); - const buttons: ISideBar["buttons"] = React.useMemo( + const buttons = React.useMemo( () => [ { name: "Home", @@ -37,12 +33,9 @@ const UserLayout = ({ children }: IUserLayout) => { ); return ( -
-
- -
-
{children}
-
+ + {children} + ); }; diff --git a/src/app/private/[uid]/user/seniors/SeniorsHomePage.tsx b/src/app/private/[uid]/user/seniors/SeniorsHomePage.tsx new file mode 100644 index 00000000..5cf90d18 --- /dev/null +++ b/src/app/private/[uid]/user/seniors/SeniorsHomePage.tsx @@ -0,0 +1,43 @@ +"use client"; + +import { UserTile } from "@components/TileGrid"; +import { Senior, User } from "@prisma/client"; +import SearchableContainer from "@components/SearchableContainer"; +import { seniorFullName } from "@utils"; + +type SeniorsHomePageProps = { + seniors: Senior[]; + user: User; +}; + +const SeniorsHomePage = ({ seniors, user }: SeniorsHomePageProps) => { + const displaySeniors = (elem: Senior, index: number) => ( + + ); + + return ( + <> +

+ {`My Assigned Seniors (${seniors.length})`} +

+ + {"You haven't been assigned a Senior yet."} + + } + search={(senior: Senior, filter: string) => + seniorFullName(senior).toLowerCase().includes(filter.toLowerCase()) + } + /> + + ); +}; + +export default SeniorsHomePage; diff --git a/src/app/private/[uid]/user/seniors/[seniorId]/page.tsx b/src/app/private/[uid]/user/seniors/[seniorId]/page.tsx new file mode 100644 index 00000000..a8c549ac --- /dev/null +++ b/src/app/private/[uid]/user/seniors/[seniorId]/page.tsx @@ -0,0 +1,46 @@ +import PathNav from "@components/PathNav"; +import { DisplaySenior } from "@components/senior"; +import { prisma } from "@server/db/client"; + +interface PageProps { + params: { + uid: string; + seniorId: string; + }; +} + +const Page = async ({ params }: PageProps) => { + const senior = await prisma.senior.findUniqueOrThrow({ + where: { + id: params.seniorId, + StudentIDs: { + has: params.uid, + }, + }, + include: { + chapter: { + include: { + students: true, + }, + }, + Files: true, + }, + }); + + return ( +
+ + +
+ ); +}; + +export default Page; diff --git a/src/app/private/[uid]/user/seniors/layout.tsx b/src/app/private/[uid]/user/seniors/layout.tsx new file mode 100644 index 00000000..ec17bdb3 --- /dev/null +++ b/src/app/private/[uid]/user/seniors/layout.tsx @@ -0,0 +1,16 @@ +import { HeaderContainer } from "@components/container"; +import { faUsers } from "@fortawesome/free-solid-svg-icons"; + +interface LayoutProps { + children?: React.ReactNode; +} + +const Layout = (props: LayoutProps) => { + return ( + + {props.children} + + ); +}; + +export default Layout; diff --git a/src/app/private/[uid]/user/seniors/page.tsx b/src/app/private/[uid]/user/seniors/page.tsx new file mode 100644 index 00000000..2730a169 --- /dev/null +++ b/src/app/private/[uid]/user/seniors/page.tsx @@ -0,0 +1,20 @@ +import React from "react"; +import { prisma } from "@server/db/client"; +import SeniorsHomePage from "./SeniorsHomePage"; + +const UserSeniorsPage = async ({ params }: { params: { uid: string } }) => { + const user = await prisma.user.findFirstOrThrow({ + where: { + id: params.uid, + }, + include: { + Seniors: true, + }, + }); + + const seniors = user.Seniors; + + return ; +}; + +export default UserSeniorsPage; diff --git a/src/app/private/layout.tsx b/src/app/private/layout.tsx deleted file mode 100644 index 8f428f6d..00000000 --- a/src/app/private/layout.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import UserProvider from "src/context/UserProvider"; - -interface IPrivateLayout { - children: React.ReactNode; -} - -const PrivateLayout = ({ children }: IPrivateLayout) => { - return {children}; -}; - -export default PrivateLayout; diff --git a/src/components/AddFile.tsx b/src/components/AddFile.tsx index e5f134af..d1e8124b 100644 --- a/src/components/AddFile.tsx +++ b/src/components/AddFile.tsx @@ -18,9 +18,7 @@ const TagSelector = ({ }) => { return (
-
- Tags -
+
Tags
items={tagList} filterMatch={(tag, text) => tag.name.indexOf(text) != -1} @@ -76,11 +74,8 @@ const AddFile = ({ {!confirm && !error ? (
-
- {" "} - Create New File{" "} -
-
+
Create New File
+
File name
File added successfully!
); - } - else { + } else { return ( ); } -} +}; export default Button; diff --git a/src/components/DisplayChapterInfo.tsx b/src/components/DisplayChapterInfo.tsx index dbd1c188..0b0aca5a 100644 --- a/src/components/DisplayChapterInfo.tsx +++ b/src/components/DisplayChapterInfo.tsx @@ -1,5 +1,3 @@ - - interface DisplayChapterInfoParams { location: string; noMembers: number; @@ -12,7 +10,7 @@ const DisplayChapterInfo = ({ dateCreated, }: DisplayChapterInfoParams) => { return ( -
+
Location:
{location}
@@ -23,7 +21,9 @@ const DisplayChapterInfo = ({
Years Active:
-
{new Date().getFullYear() - dateCreated.getFullYear()}
+
+ {new Date().getFullYear() - dateCreated.getFullYear()} +
); diff --git a/src/components/DisplayResources.tsx b/src/components/DisplayResources.tsx index ed0e8966..f35640b7 100644 --- a/src/components/DisplayResources.tsx +++ b/src/components/DisplayResources.tsx @@ -12,10 +12,13 @@ import { batchDeleteResources, } from "@api/resources/route.client"; import { compareResource } from "@utils"; +import { Spinner } from "./skeleton"; +import { createResourceSchema } from "@api/resources/route.schema"; interface IDisplayResources { resources: Resource[]; showRole: boolean; + editable: boolean; } interface ResourceState extends Resource { @@ -23,6 +26,7 @@ interface ResourceState extends Resource { } const DisplayResources = (props: IDisplayResources) => { + const [loading, setLoading] = React.useState(false); const [edit, setEdit] = React.useState(false); const [stateResources, setStateResources] = React.useState( () => @@ -30,6 +34,7 @@ const DisplayResources = (props: IDisplayResources) => { .sort(compareResource) .map((resource) => ({ state: "UNEDITED", ...resource })) ); + const [canSubmit, setCanSubmit] = React.useState(true); const onAddResource = () => { setStateResources((prev) => [ @@ -66,9 +71,12 @@ const DisplayResources = (props: IDisplayResources) => { }); }; - const getResourceByState = (state: ResourceState["state"]) => { - return stateResources - .filter((curr) => curr.state === state) + const getResourceByStates = ( + resources: ResourceState[], + states: ResourceState["state"][] + ) => { + return resources + .filter((curr) => states.includes(curr.state)) .map((curr) => { const { state, ...rest } = curr; return rest; @@ -76,11 +84,17 @@ const DisplayResources = (props: IDisplayResources) => { }; const onSaveResources = async () => { - const deletedResources = getResourceByState("DELETED").map( - (curr) => curr.id - ); - const updatedResources = getResourceByState("UPDATED"); - const createdResources = getResourceByState("CREATED"); + if (loading) { + return false; + } + + setLoading(true); + + const deletedResources = getResourceByStates(stateResources, [ + "DELETED", + ]).map((curr) => curr.id); + const updatedResources = getResourceByStates(stateResources, ["UPDATED"]); + const createdResources = getResourceByStates(stateResources, ["CREATED"]); await Promise.all([ batchCreateResources({ body: createdResources }), @@ -88,7 +102,7 @@ const DisplayResources = (props: IDisplayResources) => { batchDeleteResources({ body: deletedResources }), ]).then((res) => { const newResources: ResourceState[] = [ - ...getResourceByState("UNEDITED"), + ...getResourceByStates(stateResources, ["UNEDITED"]), ...res[0].data, ...res[1].data, ] @@ -100,50 +114,71 @@ const DisplayResources = (props: IDisplayResources) => { setStateResources(newResources); setEdit(false); + setLoading(false); + setCanSubmit(true); }); }; + React.useEffect(() => { + setCanSubmit( + getResourceByStates(stateResources, ["UPDATED", "CREATED"]) + .map((resource) => createResourceSchema.safeParse(resource)) + .every((state) => state.success) + ); + }, [stateResources, setCanSubmit]); + return ( -
-
- - {edit ? ( - - ) : ( +
+ {props.editable && ( +
- )} -
-
- {stateResources - .filter((resource) => resource.state !== "DELETED") - .map((eachResource) => ( - - ))} -
+ {edit ? ( + + ) : ( + + )} +
+ )} + {loading ? ( +
+ +
+ ) : ( +
+ {stateResources + .filter((resource) => resource.state !== "DELETED") + .map((eachResource) => ( + + ))} +
+ )}
); }; diff --git a/src/components/FilterDropdown.tsx b/src/components/FilterDropdown.tsx index 55c7fedd..56b658c8 100644 --- a/src/components/FilterDropdown.tsx +++ b/src/components/FilterDropdown.tsx @@ -84,7 +84,7 @@ export default function FilterDropdown({ > {filteredItems.map((item: T, index: number) => ( { onItemSelect(index, item); diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index fc3dee97..b4743b4c 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,31 +1,44 @@ "use client"; -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; import Link from "next/link"; import { useAuth } from "@hooks"; +import logoicon from "../../public/landing/newlegacy-logo.svg"; +import Image from "next/image"; const Navbar = () => { const [dropdownVisible, setDropdownVisible] = useState(false); const handleMenuClick: React.MouseEventHandler = () => { setDropdownVisible((visible) => !visible); }; + const { status, onSignIn } = useAuth(); + useEffect(() => { + const dropdownonResize = () => { + if (window.innerWidth > 950) { + setDropdownVisible(false); + } + }; + + window.addEventListener("resize", dropdownonResize); + + return () => { + window.removeEventListener("resize", dropdownonResize); + }; + }, []); return ( -