-
-
Notifications
You must be signed in to change notification settings - Fork 11
788-feat: Add filter for merch #904
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
base: feat/786-add-merch-page
Are you sure you want to change the base?
788-feat: Add filter for merch #904
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.
Filter functionality works correctly.
@@ -1,5 +1,5 @@ | |||
'use client'; | |||
import { useState } from 'react'; | |||
import React, { useState } from 'react'; |
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.
Why do we need to import a React here?
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
height: 5px; |
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.
Why do we need it?
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.
We have Clear button here. It appears conditionally when at least one filter is active. And these styles are for button and title positioning. But you are right about height: 5px. I had layout jump issue when hovering over the 'Clear' button. I've removed that fixed height now.
const showTagsSection = !isMobileLayout || areTagsExpandedMobile; | ||
|
||
return ( | ||
<div> |
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.
We don't need this div, lets delete it and use <></> for wrap components
)} | ||
|
||
{(!initialProducts || initialProducts.length === 0) && !hasActiveFilters && ( | ||
<p>No merch found</p> |
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.
use the Paragraph component instead of p-tag, pls
onToggleTagsExpansionMobile={toggleMobileFiltersExpansion} | ||
/> | ||
</div> | ||
<main> |
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.
why main-tag here? all content between header and footer have to be in main, isn't it?
|
||
return ( | ||
<div> | ||
<div className={cx('filter-container', { mobile: isMobileLayout })}> |
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 think we can use aside-tag here
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 initially used aside-tag. I've changed it to a div because on mobile, it's no longer a sidebar but a full-width section above the content, and looks like div semantically more appropriate in this case.
|
||
width: 18px; | ||
height: 18px; | ||
margin-right: 10px; |
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.
lets delete it and add gap for .filter-tag-label
.filter-checkbox-original:checked + .filter-checkbox-custom { | ||
border-color: $color-yellow; | ||
background-color: $color-yellow; | ||
|
||
&::after { | ||
display: block; | ||
} | ||
} |
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.
lets move it into .filter-checkbox-original :
&:checked + .filter-checkbox-custom {
border-color: $color-yellow;
background-color: $color-yellow;
&::after {
display: block;
}
}
What type of PR is this? (select all that apply)
Description
Add filter for merch page for desktop and mobile view
Add tests for filter component
Related Tickets & Documents
Screenshots, Recordings
Added/updated tests?
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?