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

Team member integration with Contentful. #92

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

brendanshen24
Copy link
Contributor

Describe your changes

Completed team member integration in Contentful. Now Team Members come from Contentful instead of teamMemberData.json.

Describe your changes

Implemented getting the preview image from Contentful and putting it on the event card.

Testing steps

  1. checkout to content-updates
  2. run pnpm install to update dependencies
  3. run the development server.

Issue ticket number and link

#91

Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for sfusurgedev ready!

Name Link
🔨 Latest commit 4e3cd1e
🔍 Latest deploy log https://app.netlify.com/sites/sfusurgedev/deploys/675a93e7e77e540008065811
😎 Deploy Preview https://deploy-preview-92--sfusurgedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 50
Accessibility: 79
Best Practices: 92
SEO: 91
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@ChrisFong604 ChrisFong604 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid client-side fetching for contentful, as it will significantly drive up the amount of requests to our contentful account for every unique visitor.

Better to restructure the code so that the data is fetched from a server component, then passed to a client component. Ensure that the request is also cached to reduce load on the server for contentful fetches.

Additional requested changes are noted in the comments. Please address and then resubmit PR once resolved

Thanks 🫡

src/app/sections/about/TeamGallery/index.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary, the request should be made using the contentfulClient through a server component, not on the client side.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EventCardProps should be using the defined EventDTO, as the purpose of a Data Transfer Object is to serialize the contentful data types to native typescript types for use in the client.

Not sure the purpose of the Image type either, is it mapped to a content type in contentful? It's easier to just get the CDN image url from the contentful request and use it directly in the image src property

src/lib/content/types/Event.ts Outdated Show resolved Hide resolved
…and stored the team member data on the user's local cache. Other than that, generally cleaned up code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants