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

Add grouped category listbox for ecosystem project form #1070

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

Conversation

CharlyMartin
Copy link
Collaborator

@CharlyMartin CharlyMartin commented Feb 4, 2025

📝 Description

This PR adds a FormListboxWithGroups for the ecosystem project form.

🛠️ Key Changes

📌 To-Do Before Merging

📸 Screenshots

CleanShot 2025-02-05 at 11 21 24@2x

🔖 Resources

Copy link

vercel bot commented Feb 4, 2025

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 Feb 7, 2025 2:11pm

@CharlyMartin CharlyMartin force-pushed the UXIT-1925/redesign-category-listbox-bis branch from 0310909 to b6bbc13 Compare February 5, 2025 11:16
@CharlyMartin CharlyMartin changed the title Add grouped listbox components for ecosystem project form Add grouped category listbox for ecosystem project form Feb 5, 2025
@CharlyMartin CharlyMartin marked this pull request as ready for review February 5, 2025 11:32
@CharlyMartin CharlyMartin requested review from mirhamasala and removed request for mirhamasala February 5, 2025 11:33
children: React.ReactNode
}

export function ListboxOptionGroup({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would ListboxGroupHeader describe this component better?

Suggested change
export function ListboxOptionGroup({
export function ListboxGroupHeader({

@@ -14,19 +15,24 @@ export type OptionType = {

type ListboxOptionProps<Value extends OptionType> = {
option: Value
grouped?: boolean
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of passing a prop, which makes the child component dependent on the parent’s state, what about applying the following style directly to ListboxOptionGroup:

<span className="block pl-1">
  {children}
</span>

This approach improves encapsulation by keeping the spacing logic within ListboxOptionGroup, ensuring that ListboxOption components remain unaware of their surrounding context. It also maintains a clearer separation of concerns.

Copy link
Collaborator

@mirhamasala mirhamasala left a comment

Choose a reason for hiding this comment

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

@CharlyMartin - Looking good - Left a naming suggestion and encapsulation suggestion nit. Thank you. 🙌🏼

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