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

[UXIT-1680] Event Page · Include moderators and speakers #767

Merged
merged 11 commits into from
Oct 29, 2024

Conversation

mirhamasala
Copy link
Collaborator

@mirhamasala mirhamasala commented Oct 29, 2024

📝 Description

This PR adds moderators and speakers fields to the event schedule configuration. This enhancement enables the content teams to include detailed information about participants in each event. Additional refactoring ensures better code organization and maintainability.

  • Type: New feature

🛠️ Key Changes

  • Event Schema Update: Added moderators and speakers fields to the event schedule schema.
  • Participants Component: Created a reusable Participants component to display event participant details, supporting both moderators and speakers.
  • ParticipantSchema: Developed a ParticipantSchema type in zod to define participant structure and enforce type safety.
  • Content Update: Updated the FIL Bangkok post to include the latest event details, integrating the new moderator and speaker fields.
  • Types Refactoring: Moved common types to a utility file for improved organization and easier access across components.
  • Code Reorganization and Refactoring: Minor improvements and cleanup for maintainability and readability.

📌 To-Do Before Merging

  • Temporarily updated test data to reflect new fields. (To be reverted before production)

🧪 How to Test

  • Setup: Ensure the latest schema and components are imported into the environment.
  • Steps to Test:
  • Open the FIL Bangkok event post to confirm content accuracy.
  • Navigate to an event with moderators and speakers to view the Participants component rendering correctly.
  • Check the layout and formatting of each participant’s details (name, company).
  • Test with events that have varying combinations of moderators, speakers, and other optional data fields to verify flexibility (see test data file).
  • Expected Results: Moderators and speakers display accurately under each event. The Participants component should correctly format and separate each participant.

📸 Screenshots

CleanShot 2024-10-29 at 16 10 15@2x

Copy link

vercel bot commented Oct 29, 2024

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

Name Status Preview Comments Updated (UTC)
filecoin-foundation-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 29, 2024 4:14pm

Copy link
Collaborator

@CharlyMartin CharlyMartin left a comment

Choose a reason for hiding this comment

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

Nice one Mirha! This is definitely gonna make our remote support role for FIL Bangkok smoother 😄

Aside from my two suggestions, what do you think about saving the tabs' state in the URL?

When a user clicks on View Details and then on the brower's back button to come back to the events page, they land on the first tab, so they have to manually find where they were. With a persisted state, they would land back on the same tab.

Based on the Headless Docs and https://nuqs.47ng.com/ it should not be too difficult.

It can definitely be another PR if you think it's worth implementing.

Comment on lines 12 to 26
export function ScheduleParticipants({
title,
participants,
}: ParticipantsProps) {
return (
<p className="text-sm">
<span className="font-semibold">{title}:</span>{' '}
<span>{participants.map(formatParticipant).join('; ')}</span>
</p>
)
}

function formatParticipant({ name, company }: Participant) {
return `${name}, ${company}`
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

UX improvement suggestion.

I find mixing commas and semicolons hard to read, it's difficult to tell if word is a person’s name or a company name when scanning the text.

Would that format be possible? Name (Company), Name (Company) and Name (Company)

I couldn't find a Figma design for this part so maybe this is already good to go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like that! Yes, apologies, should've mentioned that there's no Figma design yet.

Comment on lines 34 to 36
participants={
event.moderators as ParticipantsProps['participants']
}
Copy link
Collaborator

@CharlyMartin CharlyMartin Oct 29, 2024

Choose a reason for hiding this comment

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

If the list of participants cannot be empty, then it would be better to reflect in the schema instead of using an as type assertion here

So here we would have:

participants={event.moderators}

And in the EventSchema we would have:

moderators: z.array(ParticipantSchema).nonempty().optional(),

What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, Yes! That's perfect. Thank you.

<ScheduleParticipants
title="Speakers"
participants={
event.speakers as ParticipantsProps['participants']
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment here :)

@mirhamasala
Copy link
Collaborator Author

What do you think about saving the tabs' state in the URL?

Yes - Love this. Added a ticket . 🙏🏼

@mirhamasala mirhamasala merged commit 844eeec into main Oct 29, 2024
3 of 4 checks passed
@mirhamasala mirhamasala deleted the mm/event-page-speakers-moderators branch October 29, 2024 16:12
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