Skip to content

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

Open
wants to merge 14 commits into
base: feat/786-add-merch-page
Choose a base branch
from

Conversation

antonina220590
Copy link
Collaborator

What type of PR is this? (select all that apply)

  • πŸ• Feature
  • πŸ› Bug Fix
  • 🚧 Breaking Change
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ“ Documentation Update

Description

Add filter for merch page for desktop and mobile view
Add tests for filter component

Related Tickets & Documents

Screenshots, Recordings

desktop_view
mobile_view

Added/updated tests?

  • πŸ‘Œ Yes
  • πŸ™…β€β™‚οΈ No, because they aren't needed
  • πŸ™‹β€β™‚οΈ No, because I need help

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

Copy link
Collaborator

@TeymurDev TeymurDev left a 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.

@YulikK
Copy link
Collaborator

YulikK commented May 27, 2025

We have a problem when we use the search:
image

@@ -1,5 +1,5 @@
'use client';
import { useState } from 'react';
import React, { useState } from 'react';
Copy link
Collaborator

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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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>
Copy link
Collaborator

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>
Copy link
Collaborator

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>
Copy link
Collaborator

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 })}>
Copy link
Collaborator

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

Copy link
Collaborator Author

@antonina220590 antonina220590 May 27, 2025

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;
Copy link
Collaborator

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

Comment on lines 179 to 186
.filter-checkbox-original:checked + .filter-checkbox-custom {
border-color: $color-yellow;
background-color: $color-yellow;

&::after {
display: block;
}
}
Copy link
Collaborator

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;
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants