Skip to content

Commit

Permalink
Merge pull request #71 from hack4impact-calpoly/2023-changes
Browse files Browse the repository at this point in the history
2023 changes
  • Loading branch information
MaggieYang57 authored Jul 21, 2023
2 parents 49d13d3 + 3cb34c3 commit c6b3961
Show file tree
Hide file tree
Showing 15 changed files with 1,729 additions and 2,486 deletions.
5 changes: 0 additions & 5 deletions .env.default

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 18.16.1

- run: yarn install
- run: yarn run lint
7 changes: 5 additions & 2 deletions components/ButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ const ButtonLink = (props: ButtonLinkItem) => {

return (
<div>
<Link href={link.toString()}>
<a className={`inline-block mb-6 py-3 px-20 border-2 border-blue rounded-full ${style}`}>{text}</a>
<Link
href={link.toString()}
className={`inline-block mb-6 py-3 px-20 border-2 border-blue rounded-full ${style}`}
>
{text}
</Link>
</div>
);
Expand Down
10 changes: 5 additions & 5 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ const Footer = () => (
<div className="hidden md:w-1/2 md:flex my-auto">
<div className="w-1/3 space-y-3 px-2">
<h3 className="text-white text-2xl">General</h3>
<Link href="/about"><a className="block text-white text-lg">About</a></Link>
<Link href="/projects"><a className="block text-white text-lg">Projects</a></Link>
<Link href="/about" className="block text-white text-lg">About</Link>
<Link href="/projects" className="block text-white text-lg">Projects</Link>
</div>
<div className="w-1/3 space-y-3 px-2">
<h3 className="text-white text-2xl">Apply</h3>
<Link href="/students"><a className="block text-white text-lg">Students</a></Link>
<Link href="/nonprofits"><a className="block text-white text-lg">Nonprofits</a></Link>
<Link href="/students" className="block text-white text-lg">Students</Link>
<Link href="/nonprofits" className="block text-white text-lg">Nonprofits</Link>
</div>
<div className="w-1/3 space-y-3 px-2">
<h3 className="text-white text-2xl">Support</h3>
{/* <Link href="/sponsor"><a className="block text-white text-lg">Sponsor</a></Link> */}
<Link href="/donate"><a className="block text-white text-lg">Donate</a></Link>
<Link href="/donate" className="block text-white text-lg">Donate</Link>
</div>
</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion components/MemberCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MemberCard = (props: MemberCardItem) => {
</div>
<p className="text-xl leading-6">{name}</p>
<p className="text-md text-gray-600 italic leading-6">{title}</p>
{linkedin && <p><LinkedinLogo link={linkedin.toString()} fullLogo /></p>}
{linkedin && <LinkedinLogo link={linkedin.toString()} fullLogo />}
</div>
);
};
Expand Down
24 changes: 12 additions & 12 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Navbar = () => {
src={config.assets.logo_color}
alt="hack4impact logo, with color"
/>
<Link href="/" passHref>
<Link href="/" passHref legacyBehavior>
<span
className="block cursor-pointer font-bold sm:text-lg text-blue"
onClick={() => expand(false)}
Expand All @@ -43,27 +43,27 @@ const Navbar = () => {
</div>
<div className="hidden md:block md:space-x-4 lg:space-x-12 text-blue font-strong">
<Link href="/about">
<a>About</a>
About
</Link>
<Link href="/projects">
<a>Projects</a>
Projects
</Link>
<Link href="/students">
<a>Students</a>
Students
</Link>
<Link href="/nonprofits">
<a>Nonprofits</a>
Nonprofits
</Link>
<Link href="/donate">
<a>Donate</a>
Donate
</Link>
</div>
</div>
</div>

{expanded && (
<div className="md:hidden absolute w-full bg-gray-50 shadow-md z-10">
<Link href="/" passHref>
<Link href="/" passHref legacyBehavior>
<span
className="block cursor-pointer font-bold sm:text-lg text-blue px-6 py-3 border-blue border-b-2"
onClick={() => expand(!expanded)}
Expand All @@ -74,7 +74,7 @@ const Navbar = () => {
Home
</span>
</Link>
<Link href="/about" passHref>
<Link href="/about" passHref legacyBehavior>
<span
className="block cursor-pointer font-bold sm:text-lg text-blue px-6 py-3 border-blue border-b-2"
onClick={() => expand(!expanded)}
Expand All @@ -85,7 +85,7 @@ const Navbar = () => {
About us
</span>
</Link>
<Link href="/projects" passHref>
<Link href="/projects" passHref legacyBehavior>
<span
className="block cursor-pointer font-bold sm:text-lg text-blue px-6 py-3 border-blue border-b-2"
onClick={() => expand(!expanded)}
Expand All @@ -96,7 +96,7 @@ const Navbar = () => {
Projects
</span>
</Link>
<Link href="/students" passHref>
<Link href="/students" passHref legacyBehavior>
<span
className="block cursor-pointer font-bold sm:text-lg text-blue px-6 py-3 border-blue border-b-2"
onClick={() => expand(!expanded)}
Expand All @@ -107,7 +107,7 @@ const Navbar = () => {
Students
</span>
</Link>
<Link href="/nonprofits" passHref>
<Link href="/nonprofits" passHref legacyBehavior>
<span
className="block cursor-pointer font-bold sm:text-lg text-blue px-6 py-3 border-blue border-b-2"
onClick={() => expand(!expanded)}
Expand All @@ -118,7 +118,7 @@ const Navbar = () => {
Nonprofits
</span>
</Link>
<Link href="/donate" passHref>
<Link href="/donate" passHref legacyBehavior>
<span
className="block cursor-pointer font-bold sm:text-lg text-blue px-6 py-3 border-blue border-b-2"
onClick={() => expand(!expanded)}
Expand Down
7 changes: 5 additions & 2 deletions components/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ const ProjectCard = (props: {project: ProjectCardItem}) => {

<p>{project.blurb}</p>
<p>
<Link href={`projects/${project.slug}`}>
<a className="font-strong text-blue text-lg">Read more &rarr;</a>
<Link
href={`projects/${project.slug}`}
className="font-strong text-blue text-lg"
>
Read more &rarr;
</Link>
</p>
</div>
Expand Down
1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
},
"dependencies": {
"@heroicons/react": "^1.0.4",
"contentful": "^9.1.32",
"next": "11.1.0",
"contentful": "^9.3.5",
"next": "^13.4.10",
"node-fetch": "^2.6.1",
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node-fetch": "^2.5.12",
Expand All @@ -25,13 +25,13 @@
"autoprefixer": "^10.3.7",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-next": "11.1.0",
"eslint-config-next": "^13.4.10",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"postcss": "^8.3.10",
"tailwindcss": "^2.2.17",
"typescript": "4.3.5"
"typescript": "4.5.2"
}
}
80 changes: 42 additions & 38 deletions pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@ import React from 'react';
import Head from 'next/head';

import contentful from '../utils/contentful';
import { MemberCardItem, TestimonalProps } from '../utils/types';
import { InfoCardItem, MemberCardItem } from '../utils/types';

import ImageCard from '../components/ImageCard';
import Carousel from '../components/Carousel';
import Testimonial from '../components/Testimonial';
import MemberCard from '../components/MemberCard';
import InfoCard from '../components/InfoCard';

interface AboutProps {
page: {
title: String;
description: String;
}
testimonials: TestimonalProps[];
people: {
directors: MemberCardItem[];
members: MemberCardItem[];
alumni: MemberCardItem[];
}
},
info: InfoCardItem[];
}

const About = (props: AboutProps) => {
const { page, testimonials, people } = props;
const {
page, people, info,
} = props;

return (
<>
Expand All @@ -38,13 +39,13 @@ const About = (props: AboutProps) => {

<ImageCard img="/photos/showcase-2019.png" alt="Club Showcase 2019" />

<section className="space-y-8">
<h2>Hear from our members</h2>
<Carousel>
{testimonials.map((t) => (
<Testimonial key={t.member.name} member={t.member} quote={t.quote} />
<section className="flow-root space-y-6 md:space-y-10">
<h2>Our events</h2>
<div className="grid md:grid-cols-3 gap-12 md:gap-16">
{info.map((card) => (
<InfoCard key={card.title} title={card.title} body={card.body} image={card.image} />
))}
</Carousel>
</div>
</section>

<section className="space-y-6">
Expand Down Expand Up @@ -102,21 +103,19 @@ export async function getStaticProps() {
items {
title
description
}
}
testimonials: testimonialCollection (where:{display:true}) {
items {
member {
fullName
linkedIn
profilePicture {
url(transform: {width:400, format:WEBP})
info: infoCardCollection(limit:3) {
items {
title
body
image {
url(transform: {width:400, format:WEBP})
description
}
}
}
class
quote
}
}
directors: personCollection (where:{role_contains:"Director", isActive:true, isAlumni:false}, order:fullName_ASC) {
items {
fullName
Expand Down Expand Up @@ -150,23 +149,28 @@ export async function getStaticProps() {
}
}`;

interface InfoCardContent {
title: string;
body: string;
image: {
url: string;
description: string;
}
}

const res = await contentful.query(pageQuery);
const page = res.page.items[0];
const testimonialData = res.testimonials.items;
const directorData = res.directors.items;
const memberData = res.members.items;
const alumniData = res.alumni.items;

const testimonials: TestimonalProps = testimonialData.map((t: any) => ({
member: {
headshot: {
url: t.member.profilePicture?.url,
},
name: t.member.fullName,
linkedin: t.member.linkedIn,
title: t.class,
const info = page.info.items.map((item: InfoCardContent): InfoCardItem => ({
title: item.title,
body: item.body,
image: {
url: item.image.url,
alt: item.image.description,
},
quote: t.quote,
}));

function contentfulToMemberCard(p: any): MemberCardItem {
Expand All @@ -184,8 +188,8 @@ export async function getStaticProps() {
const roles = [
'Co-Founder',
'Co-Executive Director',
'Director of Product',
'Director of Engineering',
'Director of Product & Outreach',
'Director of Design',
'Director of Finance',
'Director of Operations',
Expand All @@ -194,11 +198,11 @@ export async function getStaticProps() {
'Director of Public Relations',
'Director of Membership',
'Director of Community',
'Associate Director of Product',
'Associate Director of Design & Public Relations',
'Associate Director of Engineering',
'Product Manager',
'Associate Director of Product & Outreach',
'Associate Director of Design & Public Relations',
'Tech Lead',
'Product Manager',
'Designer',
'Designer and Developer',
'Software Developer',
Expand All @@ -225,7 +229,7 @@ export async function getStaticProps() {
return {
props: {
page,
testimonials,
info,
people: { directors, members, alumni },
},
};
Expand Down
11 changes: 11 additions & 0 deletions pages/nonprofits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ const Nonprofits = (props: NonprofitsProps) => {
<main className="mx-6 md:mx-auto md:w-4/5 lg:w-2/3 my-6 lg:my-12 space-y-8 lg:space-y-20">
<Header title={header.title} description={header.description} button={header.button} illustration="bg-nonprofits" />

<iframe
className="video"
style={{ marginLeft: 'auto', marginRight: 'auto' }}
width="550"
height="313"
src="https://www.youtube.com/embed/2XxA6LcSKa8?start=25"
title="testimonials"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowFullScreen
/>

<div className="flow-root space-y-10">
<h2>Application process</h2>
<Timeline events={events} />
Expand Down
Loading

0 comments on commit c6b3961

Please sign in to comment.