Skip to content
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

chore(deps): bump the major-production-dependencies group with 1 update #264

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.9.0
6 changes: 3 additions & 3 deletions __tests__/[id].test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '@testing-library/jest-dom';
import { FilterProvider } from '../context/FilterContext';
import { ViewProvider } from '../context/ViewContext';
import apiService from '../services/apiService';
import DetailPage, { getServerSideProps } from '../pages/[id]';
import DetailPage, { getStaticProps } from '../pages/[id]';

const MOCK_TEAM_MEMBER = {
firstName: 'Aragorn',
Expand Down Expand Up @@ -39,7 +39,7 @@ describe('DetailPage', () => {
});
});

describe('getServerSideProps', () => {
describe('getStaticProps', () => {
it('calls getMemberById', async () => {
const context = {
params: {
Expand All @@ -51,7 +51,7 @@ describe('getServerSideProps', () => {
},
},
};
const response = await getServerSideProps(context);
const response = await getStaticProps(context);

expect(response).toEqual(
expect.objectContaining({
Expand Down
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
};

module.exports = nextConfig
module.exports = nextConfig;
139 changes: 51 additions & 88 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"node": ">=20"
},
"dependencies": {
"next": "13.4.7",
"next": "14.0.2",
"react": "18.2.0",
"react-dom": "18.2.0"
},
Expand Down
29 changes: 20 additions & 9 deletions pages/[id].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export default function DetailPage({ fetchedTeamMember }) {
<Layout>
<Head>
<title>{`${fullName} | Sparkbox Team Availability`}</title>
<meta name="description" content={`View details about ${fullName}, including their projects, skills, and interests.`} />
<meta
name="description"
content={`View details about ${fullName}, including their projects, skills, and interests.`}
/>
</Head>
<PersonalOverview
name={fullName}
Expand All @@ -42,9 +45,7 @@ export default function DetailPage({ fetchedTeamMember }) {
/>
</PersonalOverview>

<Projects
currentProjects={fetchedTeamMember.currentProjects}
/>
<Projects currentProjects={fetchedTeamMember.currentProjects} />

<SkillsGrid skilldata={skills} />

Expand All @@ -64,12 +65,22 @@ export default function DetailPage({ fetchedTeamMember }) {
);
}

export async function getServerSideProps({ params, req }) {
export async function getStaticPaths() {
const teamMembers = await apiService.getAllTeamMembers();

return {
paths: teamMembers.map(({ id }) => ({
params: {
id,
},
})),
fallback: false,
};
}

export async function getStaticProps({ params }) {
const { id } = params;
const { host } = req.headers;
const scheme = process.env.NODE_ENV === 'development' ? 'http://' : 'https://';
const baseUrl = `${scheme}${host}/api/fellowship/`;
const fetchedTeamMember = await apiService.getTeamMemberById(baseUrl, id);
const fetchedTeamMember = await apiService.getTeamMemberById(id);

if (!fetchedTeamMember) {
return {
Expand Down
7 changes: 2 additions & 5 deletions pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import WeekSelect from '../components/WeekSelect';
import getUniqueCurrentProjects from '../util/getUniqueCurrentProjects';
import getUniqueRoles from '../util/getUniqueRoles';

const scheme = process.env.NODE_ENV === 'development' ? 'http://' : 'https://';

export default function Home({ teamMembers }) {
const uniqueRoles = getUniqueRoles(teamMembers);
const currentProjects = getUniqueCurrentProjects(teamMembers);
Expand All @@ -29,9 +27,8 @@ export default function Home({ teamMembers }) {
);
}

export async function getServerSideProps({ req }) {
const { host } = req.headers;
const teamMembers = await apiService.getAllTeamMembers(`${scheme}${host}/api/fellowship/`);
export async function getStaticProps() {
const teamMembers = await apiService.getAllTeamMembers();

return {
props: {
Expand Down
Loading