-
Notifications
You must be signed in to change notification settings - Fork 63
Refactor SearchTypePopover desktop header #1842
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/1842 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
Size Change: -185 B (0%) Total Size: 814 kB
ℹ️ View Unchanged
|
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.
- The search bar in VHeaderDesktop appears to fill all available space; is that the correct behavior or is it meant to have a max-width?
- I don't think it matters since this will be replaced, but there's a slight alignment problem in a medium breakpoint:
<div class="hidden lg:block">
<VHeaderDesktop />
</div>
<div class="block lg:hidden">
<VHeader />
</div>
The main goal of this PR is to get rid of the components that have duplicate names, and to separate the two
The current solution has the following downsides:
There are a couple of downsides to this CSS solution:
I was mainly trying to optimize for the mobile experience/performance because mobile usually has lower bandwidths. Do you think it's better to use CSS, @zackkrida, and reduce the need for JS hacks? |
@obulat I think we can follow your solution instead of a CSS approach. We can use the session cookie approach later to fix any visual flashes. Your point about the bundle size is a good one. |
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.
LGTM and get those components removed.
12acc1e
to
0ba8a51
Compare
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.
LGTM!
}" | ||
aria-hidden="true" | ||
:data-prefers-reduced-motion="prefersReducedMotion" | ||
data-testid="logo-loader" | ||
class="inline-flex h-12 w-12 items-center justify-center rounded p-3 md:h-12 md:w-12" | ||
class="inline-flex items-center justify-center rounded p-3 md:h-12 md:w-12" |
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.
Do the md:
height and width classes not need to be moved?
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.
Moved to the beginning of the class list? I think the prefixed classes are always at the end.
Fixes
Fixes #1836 by @obulat
Description
This PR creates a
VHeaderDesktop
component that will be used on widths abovelg
. It refactors theVSearchTypePopover
to only open the popover (so, it removes the modal). It also refactors the desktop filters button to only open the sidebar.This PR adds an
IsMinScreenLg
provide
value in thedefault.vue
layout that is set to true only after the layout was mounted. This enables us to have components rendered conditionally (withv-if
) without getting the server and client mismatch on rendering.Testing Instructions
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin