-
Notifications
You must be signed in to change notification settings - Fork 2
CI-3648 Responsiveness Improvements #86
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
Merged
Mudaafi
merged 7 commits into
main
from
ci-3648-mvp-os-ui-plp-mobile-friendly-styles-for-filters
Aug 29, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d35a719
responsiveness improvements
lordvkrum 0f1567f
improving testing coverage
lordvkrum fd3fb68
docs improvements
lordvkrum 725cf91
Merge remote-tracking branch 'origin/main' into ci-3648-mvp-os-ui-plp…
lordvkrum 9e8e6fa
Merge remote-tracking branch 'origin/main' into ci-3648-mvp-os-ui-plp…
lordvkrum 9c6574c
code improvements after review
lordvkrum 4e95c65
code improvements
lordvkrum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import React, { useState } from 'react'; | ||
| import '@testing-library/jest-dom'; | ||
| import { render, fireEvent, waitFor } from '@testing-library/react'; | ||
| import MobileModal from '../../../src/components/MobileModal'; | ||
|
|
||
| function Wrapper() { | ||
| const [isOpen, setIsOpen] = useState(false); | ||
|
|
||
| return ( | ||
| <div> | ||
| <button type='button' onClick={() => setIsOpen(true)}> | ||
| Open | ||
| </button> | ||
| <MobileModal isOpen={isOpen} setIsOpen={setIsOpen}> | ||
| Content | ||
| </MobileModal> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| describe('MobileModal Component', () => { | ||
| it('renders the modal when open', () => { | ||
| const { getByText, queryByText } = render(<Wrapper />); | ||
|
|
||
| expect(queryByText('Content')).not.toBeInTheDocument(); | ||
|
|
||
| fireEvent.click(getByText('Open')); | ||
|
|
||
| expect(getByText('Content')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('should dismiss modal when clicking in backdrop', () => { | ||
| const { getByText, queryByText, getByRole } = render(<Wrapper />); | ||
|
|
||
| fireEvent.click(getByText('Open')); | ||
|
|
||
| expect(getByText('Content')).toBeInTheDocument(); | ||
|
|
||
| fireEvent.click(getByRole('presentation')); | ||
|
|
||
| waitFor(() => { | ||
| expect(queryByText('Content')).not.toBeInTheDocument(); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,77 @@ | ||
| .cio-plp-grid { | ||
| display: grid; | ||
| grid-template-columns: 1fr 3fr; | ||
| gap: 20px; | ||
| padding: 20px; | ||
| display: grid; | ||
| grid-template-columns: 1fr 3fr; | ||
| gap: 20px; | ||
| padding: 20px; | ||
| } | ||
|
|
||
| .cio-filters-container { | ||
| padding: 20px; | ||
| padding: 20px; | ||
| } | ||
|
|
||
| .cio-filters-modal-button { | ||
| display: flex; | ||
| gap: 10px; | ||
| align-items: center; | ||
| background: none; | ||
| border: none; | ||
| cursor: pointer; | ||
| padding: 10px; | ||
| text-align: left; | ||
| outline: none; | ||
| font-size: 16px; | ||
| } | ||
|
|
||
| @media (max-width: 768px) { | ||
| .cio-plp-grid { | ||
| grid-template-columns: 1fr; | ||
| } | ||
|
|
||
| .cio-plp-grid .cio-product-tiles-container { | ||
| grid-template-columns: 1fr 1fr; | ||
| } | ||
|
|
||
| .cio-products-header-title { | ||
| width: 100%; | ||
| flex-grow: 1; | ||
| text-align: center; | ||
| } | ||
| } | ||
|
|
||
| .cio-products-container { | ||
| display: flex; | ||
| flex-direction: column; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .cio-products-header-wrapper { | ||
| justify-content: space-between; | ||
| } | ||
|
|
||
| .cio-mobile-products-header-wrapper { | ||
| justify-content: center; | ||
| } | ||
|
|
||
| .cio-products-header-container { | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| padding: 10px 5px; | ||
| .cio-products-header-wrapper, | ||
| .cio-mobile-products-header-wrapper { | ||
| display: flex; | ||
| flex-direction: row; | ||
| align-items: center; | ||
| padding: 10px 5px; | ||
| } | ||
|
|
||
| .cio-product-tiles-container { | ||
| display: grid; | ||
| grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); | ||
| gap: 10px; | ||
| display: grid; | ||
| grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); | ||
| gap: 10px; | ||
| } | ||
|
|
||
| .cio-products-container .cio-product-tile { | ||
| padding: 5px; | ||
| padding: 5px; | ||
| } | ||
|
|
||
| .cio-products-container .cio-pagination-container { | ||
| display: flex; | ||
| justify-content: center; | ||
| padding: 10px; | ||
| margin-top: 20px; | ||
| display: flex; | ||
| justify-content: center; | ||
| padding: 10px; | ||
| margin-top: 20px; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import React from 'react'; | ||
|
|
||
| export default ( | ||
| <svg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'> | ||
| <path | ||
| d='M0.850098 5H3.5M19.1501 5H9.5' | ||
| stroke='#999999' | ||
| strokeWidth='1.7' | ||
| strokeLinecap='round' | ||
| strokeLinejoin='round' | ||
| /> | ||
| <path | ||
| d='M9.5 5C9.5 6.65685 8.15685 8 6.5 8C4.84315 8 3.5 6.65685 3.5 5C3.5 3.34315 4.84315 2 6.5 2C8.15685 2 9.5 3.34315 9.5 5Z' | ||
| stroke='#999999' | ||
| strokeWidth='1.7' | ||
| strokeLinecap='round' | ||
| strokeLinejoin='round' | ||
| /> | ||
| <path | ||
| d='M19.1499 15H16.5M0.849903 15H10.5' | ||
| stroke='#999999' | ||
| strokeWidth='1.7' | ||
| strokeLinecap='round' | ||
| strokeLinejoin='round' | ||
| /> | ||
| <path | ||
| d='M10.5 15C10.5 16.6569 11.8431 18 13.5 18C15.1569 18 16.5 16.6569 16.5 15C16.5 13.3431 15.1569 12 13.5 12C11.8431 12 10.5 13.3431 10.5 15Z' | ||
| stroke='#999999' | ||
| strokeWidth='1.7' | ||
| strokeLinecap='round' | ||
| strokeLinejoin='round' | ||
| /> | ||
| </svg> | ||
| ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.