-
Notifications
You must be signed in to change notification settings - Fork 64
Add desktop content switcher to the home page #613
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this PR related to #607 ?
const labelKey = { | ||
image: 'search-type.image', | ||
audio: 'search-type.audio', | ||
all: 'search-type.all', | ||
video: 'search-type.video', | ||
}[props.activeItem] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always liked this approach to mapping variables to a different result (using an object inline). 🙂
I have been thinking about the Content Switcher only as part of the Header for a very long time. And just a couple of days ago I looked at the homepage, and realized that the same component is used inside the search bar. This made me rethink the organization of all of the components related to the switching of content types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, what an amazing surprise, I assumed this would be on the old homepage! This is great. @dhruvkb I want to make sure you're aware of this since you're working on finishing the homepage.
@dhruvkb feel free to merge this without additional review if it is helpful to your homepage PR; the specific details can be discussed there. |
It will definitely be very useful, let me resolve the conflicts and merge it. Tagging @obulat for the notification. |
…ntend into add_desktop_switcher
Fixes
Related to #592
Description
This PR adds a Content Type switcher to the desktop version of the homepage. I've done it to test out how well the content switcher popover works when not in the header, and to see how best to handle state. It turns out that to make the component work well both in the header and on the homepage, it is easier to handle state (i.e. currently selected item) of the
VContentTypePopover
from the parent.Testing Instructions
Run
pnpm run dev
, and open the home page. You should be able to see the content switcher inside the search bar, and also to select a content type from the dropdown (popover). The search itself is not functioning yet.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin