-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor archive #38
base: main
Are you sure you want to change the base?
Refactor archive #38
Conversation
useEffect(() => { | ||
const fetchTeamData = async () => { | ||
const response = await fetch(`/team/data/${year}.json`); | ||
const data = await response.json(); | ||
setTeam(data); | ||
}; | ||
|
||
fetchTeamData(); | ||
}, [year]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can just be fixed by importing json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import staffInfo from '../info/staff-info.json';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want one large json file that contains the staff info for every year then?
Adding the new year's team involves four steps:
<year>.json
to/public/team/data
/public/team/photos/<year>/
years
array incomponents/Team/Team.tsx
components/Team/Team.tsx
to new year