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

Fixes #12 - Implement Events page #28

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

Conversation

mrzamin
Copy link

@mrzamin mrzamin commented Jun 7, 2024

🔗 Links

🗒️ What & Why

  1. Create test data for the purpose of testing the data fetching process of the Events page components.
    • Create a test-data directory with 3 markdown files inside this directory (20240701.md, 20240702.md, and 20240703.md) containing dummy data.
    • Per RFC-001, each unique event's data will be stored in a markdown file with YAML front matter.
    • The markdown files listed above are for testing purposes only. They do not represent the final data structure decided upon by the group.
  2. Create a file getEventsData.js with a function for reading and sorting the markdown files from the file system.
    • Use gray-matter library to parse each markdown file's YAML front matter.
  3. Create an /events route by adding an events subfolder inside the pages directory and adding an index.tsx file inside it.
  4. Create 3 components related to the Events page:
    • EventsPage component located in src/pages/events/index.tsx
    • EventsList component located in src/components
    • EventCard component located in src/components
  5. Use the next.js fetching method getStaticProps to fetch the dummy events data and use it within the EventsPage component.
  6. Implement basic styles using CSS modules
    • EventsList.module.css
    • EventCard.module.css

🎨 Designs

N/A

🧪 Test Steps

Copy link

vercel bot commented Jun 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2024 3:31pm

Copy link
Collaborator

@quinnmcphail quinnmcphail left a comment

Choose a reason for hiding this comment

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

I added a few comments. Let me know if you have any questions!

<div className={`${styles["event-card"]}`}>
<div className={`${styles["left-container"]}`}>
<div className={`${styles["date-container"]}`}>
<h3>Date</h3>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Be careful with the section heading tags. If you look at the structure you currently have, it goes from h3 to h2 in the code. While it visually may not look like that, when viewing the site with screen readers, or when it gets crawled by Google for SEO, the tags will be out of order. To remediate this, I would first add an h1 tag at the top of the page, and then leave the event title as h2 tags. The date, if it eventually should house a date, should use the time HTML element instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

@quinnmcphail Thank you for this comment regarding SEO best practices. I'm learning how super important they are. To fix this, I added an h1 tag at the top of the EventsPage component and committed that change to this pull request.

Copy link
Author

@mrzamin mrzamin Jun 12, 2024

Choose a reason for hiding this comment

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

@quinnmcphail I changed both of the time-related elements to time tags. I don't know how the group wants to handle transforming the ISO dates from the markdown files. That's why I simply put placeholder text there, but eventually we'll convert the ISO dates to readable text (with a JS function?) and make the date text dynamic. I also added the "dateTime" attribute to the tags, although the values for the attribute will eventually be dynamic too.

Those changes have been committed to this pull request.

Comment on lines 15 to 28
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={1.5}
stroke="currentColor"
className={`${styles["meeting-time-icon"]}`}
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
/>
</svg>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may want to include the heroicons library instead of referencing the SVG. Documentation on how to do that is located here: https://github.com/tailwindlabs/heroicons?tab=readme-ov-file#react

Copy link
Author

Choose a reason for hiding this comment

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

@quinnmcphail Thanks, I didn't know that was an available option. I removed the SVGs and imported the heroicon components. It makes everything look simpler/cleaner. That change has been committed to this pull request.

Comment on lines 34 to 52
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
className={`${styles["meeting-location-icon"]}`}
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
/>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"
/>
</svg>
Copy link
Collaborator

Choose a reason for hiding this comment

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

/>
</svg>
</div>
<p>{startDateTime}</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also will want to use the time element referenced above.

Copy link
Author

@mrzamin mrzamin Jun 12, 2024

Choose a reason for hiding this comment

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

@quinnmcphail Thank you for these comments!

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.

Implement Events page
2 participants