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

Adding prismic integration #58

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

janekamata
Copy link
Contributor

@janekamata janekamata commented Nov 10, 2024

ℹ️ Issue

Closes #54 #45 #31 #39

📝 Description

Completed projects page and case study page

Briefly list the changes made to the code:

  1. Added loader to projects route
  2. Changed input to carousel from hard coded example to formatted data from Prismic
  3. Added loader to case route
  4. Changed input to case to data from Prismic
  5. Styled projects page
  6. Styled case page
  7. Connected case to projects via Project Page -> Case Study

✔️ Verification

Made the changes and checked that the new content from Prismic was changing and updating with changes in Prismic

image
image
image

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

@janekamata janekamata self-assigned this Nov 11, 2024
Copy link
Collaborator

@circlegov circlegov left a comment

Choose a reason for hiding this comment

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

LGTM, left some questions and small suggestions

@@ -12,6 +12,8 @@ export default {
},
boxShadow: {
default: "8px 8px 0px 0px #4A4A51",
button: "4px 4px 0px 0px #4A4A51",
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a difference between button and buttonlight?

solution?: string;
website_image?: string;
link?: string;
logo?: string | null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why | null? If prismic returns null values by default ( i forgot if they do), then it would make sense for it to be either only string | null or kept as string | undefined and set to undefined wherever it is passed if it is null.

Side note: link?: string directly translates to link: string | undefined. docs

title: asText(project?.title),
introduction: asText(project?.description),
problem_statement: asText(project?.case_problem),
solution: asText(project?.case_problem),
Copy link
Collaborator

Choose a reason for hiding this comment

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

it looks like you're using the ?? to default to undefined for some of the props, should we just default to it for all of them and keep the original case types?


const projectsList = projects.map((project) => ({
logo: asImageSrc(project.logo_image) ?? undefined,
title: asText(project.title),
Copy link
Collaborator

Choose a reason for hiding this comment

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

does asText default to "" if the input is undefined?

subtitle: asText(project.subtitle),
description: asText(project.description),
has_case: project.has_case_study,
link: `http://localhost:5173/case/${asText(project.title)}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe you can pass in the route, so case/${stuff}, and in the projects component you can use a Link component with a to=case/${stuff}. relevant docs

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.

Project Page - Prismic(CMS) integration
4 participants