Skip to content

Commit 6541d47

Browse files
Su Yeon LeeSu Yeon Lee
authored andcommitted
fixes
1 parent 6f7d5ff commit 6541d47

File tree

8 files changed

+80
-42
lines changed

8 files changed

+80
-42
lines changed

components/memberIcon.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,21 @@ const TeamMemberIcon = ({ name, title, image, memberSlug, linkedIn }) => {
3030
</div>
3131
<style jsx>{`
3232
.team-icon {
33-
width: 80%;
33+
width: 120px;
34+
height: 120px;
35+
object-fit: cover;
36+
border: 3px solid #f8f9fa;
3437
}
3538
.linkedin-icon {
3639
margin-bottom: 3px;
3740
}
3841
.team-icon:hover {
3942
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
43+
transform: scale(1.05);
44+
transition: all 0.3s ease;
45+
}
46+
.member-icon {
47+
margin-bottom: 20px;
4048
}
4149
`}</style>
4250
</Col>

components/projects/Team.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import MemberIcon from '../memberIcon';
22
import { Container, Row } from 'reactstrap';
33

4-
function Team({ members }) {
4+
function Team({ title, members }) {
55
return (
66
<section className="pt-5 mt-5">
7-
<h2>Team Members</h2>
7+
<h2>{title}</h2>
88
<Container>
99
<Row>
1010
{members.map((member) => (

components/projects/featureSlider.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { Row, Col } from 'reactstrap';
33
import { Spring } from 'react-spring/renderprops.cjs';
4-
import ContentBlock from '../ContentBlock';
4+
import TextBlock from '../TextBlock';
55

66
function FeatureSlider({ features }) {
77
const [currFeatureHeader, setCurrFeatureHeader] = React.useState(features[0].header);
@@ -23,7 +23,7 @@ function FeatureSlider({ features }) {
2323
<img
2424
className="img-fluid shadow"
2525
src={image.url}
26-
alt={image.description}
26+
alt={image.description.json}
2727
/>
2828
</div>
2929
)}
@@ -44,7 +44,7 @@ function FeatureSlider({ features }) {
4444
onClick={() => setCurrFeatureHeader(header)}>
4545
<div className="pl-3">
4646
<h3 className="feature-title">{header}</h3>
47-
{body && <ContentBlock content={body.json} />}
47+
{body && <TextBlock content={body} />}
4848
</div>
4949
</button>
5050
</Row>

pages/projects/[projectSlug].jsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function ProjectPage({
2323
testimonialsCollection,
2424
technologiesUsed,
2525
teamMembersCollection,
26+
pmtlCollection,
2627
}) {
2728
return (
2829
<>
@@ -85,8 +86,8 @@ function ProjectPage({
8586
/>
8687
);
8788
})}
88-
{teamMembersCollection.items.length > 0 && <Team members={teamMembersCollection.items} />}
89-
89+
{pmtlCollection.items.length > 0 && <Team title="Project Leads" members={pmtlCollection.items} />}
90+
{teamMembersCollection.items.length > 0 && <Team title="Team Members" members={teamMembersCollection.items} />}
9091
<Row className="d-flex justify-content-center mb-5">
9192
<ActionButton white link="/projects">
9293
See more of our projects
@@ -119,22 +120,22 @@ export default ProjectPage;
119120

120121
export async function getStaticPaths() {
121122
try {
122-
const {
123-
pennWebsiteLayout: { projectsCollection },
123+
const {
124+
pennWebsiteLayout: { projectsCollection },
124125
} = await fetchNotionContent('projects');
125126

126-
const paths = projectsCollection.items
127+
const paths = projectsCollection.items
127128
.filter((x) => !!x && !!x.urlSlug)
128-
.map(({ urlSlug }) => ({
129-
params: {
130-
projectSlug: urlSlug,
131-
},
132-
}));
129+
.map(({ urlSlug }) => ({
130+
params: {
131+
projectSlug: urlSlug,
132+
},
133+
}));
133134

134-
return {
135-
paths,
136-
fallback: false,
137-
};
135+
return {
136+
paths,
137+
fallback: false,
138+
};
138139
} catch (error) {
139140
console.error('Error in getStaticPaths:', error);
140141
return {
@@ -150,15 +151,15 @@ export async function getStaticProps({ params: { projectSlug } }) {
150151

151152
if (!formattedProject) {
152153
throw new Error(`No project found with slug: ${projectSlug}`);
153-
}
154+
}
154155

155-
return {
156+
return {
156157
props: formattedProject,
157158
};
158159
} catch (error) {
159160
console.error('Error fetching project detail:', error);
160161
return {
161162
notFound: true,
162-
};
163+
};
163164
}
164165
}

pages/projects/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import fetchNotionContent from '../../utils/fetchContent';
77
import ActionButton from '../../components/actionButton';
88

99
function Projects({ projects }) {
10+
console.log(projects);
1011
return (
1112
<div>
1213
<Head title="Our Work" />

pages/team/[memberSlug].jsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,16 @@ export async function getStaticPaths() {
102102

103103
const paths = allMembers.memberCollection.items
104104
.filter(member => !!member.urlSlug)
105-
.map(({ urlSlug }) => ({
106-
params: {
107-
memberSlug: urlSlug,
108-
},
109-
}));
105+
.map(({ urlSlug }) => ({
106+
params: {
107+
memberSlug: urlSlug,
108+
},
109+
}));
110110

111-
return {
112-
paths,
113-
fallback: false,
114-
};
111+
return {
112+
paths,
113+
fallback: false,
114+
};
115115
} catch (error) {
116116
console.error('Error in getStaticPaths:', error);
117117
return {
@@ -124,11 +124,11 @@ export async function getStaticPaths() {
124124
export async function getStaticProps({ params: { memberSlug } }) {
125125
try {
126126
const memberData = await fetchMemberDetail(memberSlug);
127-
127+
128128
if (!memberData) {
129129
console.error(`No member found with slug: ${memberSlug}`);
130-
return { notFound: true };
131-
}
130+
return { notFound: true };
131+
}
132132

133133
return {
134134
props: memberData,

utils/fetchContent.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ function parseFeatureCollection(featureImagesText, featureDescriptionsText) {
7676
url: url,
7777
description: descriptions[index] || `Feature ${index + 1} screenshot`
7878
},
79-
body: {
80-
json: descriptions[index] || `Description for feature ${index + 1}`
81-
}
79+
body: descriptions[index] || `Description for feature ${index + 1}` // ← Return plain text, not wrapped in json
8280
}));
8381
}
8482

@@ -123,6 +121,12 @@ export async function fetchProjectDetail(urlSlug) {
123121
testimonialsCollection: {
124122
items: []
125123
},
124+
pmtlCollection: {
125+
items: properties.pmtl?.people?.map(person => ({
126+
name: person.name || 'Team Member',
127+
image: { url: person.avatar_url || '' },
128+
})) || []
129+
},
126130
teamMembersCollection: {
127131
items: properties.team?.people?.map(person => ({
128132
name: person.name || 'Team Member',
@@ -226,7 +230,12 @@ export async function fetchNotionContent(type, options = {}) {
226230
throw new Error(`Unknown content type: ${type}`);
227231
}
228232
} catch (error) {
229-
console.error(`There was a problem retrieving content for type ${type}:`, error);
233+
console.error(`DETAILED ERROR fetching ${type}:`, {
234+
message: error.message,
235+
code: error.code,
236+
status: error.status,
237+
stack: error.stack
238+
});
230239
throw error;
231240
}
232241
}

utils/projectYear.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
export default function groupByYearSort(a, b) {
2-
const yearA = parseInt(a[0].split(' ')[1]);
3-
const yearB = parseInt(b[0].split(' ')[1]);
4-
return yearB - yearA;
2+
// Extract semester and year from strings like "Spring 2023" or "Fall 2023"
3+
const [semesterA, yearA] = a[0].split(' ');
4+
const [semesterB, yearB] = b[0].split(' ');
5+
6+
const yearNumA = parseInt(yearA);
7+
const yearNumB = parseInt(yearB);
8+
9+
// First sort by year (newest first)
10+
if (yearNumA !== yearNumB) {
11+
return yearNumB - yearNumA;
12+
}
13+
14+
// If same year, sort by semester (Fall comes after Spring chronologically)
15+
const semesterOrder = {
16+
'Spring': 1,
17+
'Fall': 2,
18+
};
19+
20+
const orderA = semesterOrder[semesterA] || 0;
21+
const orderB = semesterOrder[semesterB] || 0;
22+
23+
return orderB - orderA;
524
}

0 commit comments

Comments
 (0)