This repository has been archived by the owner on Jun 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
[FSSS-170] Chore: tweaks search page #293
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1fb3cca
Removes unused title
eduardoformiga 5aaef94
Extracts css from product-gallery section
eduardoformiga 1f7e0bb
Merge branch 'develop' into feat/style-search-page
eduardoformiga 3d41fea
Tweaks SROnly component
eduardoformiga 7667408
Adds SROnly h1 title to search page
eduardoformiga 3d62d69
Merge branch 'develop' into feat/style-search-page
eduardoformiga 3aaade0
Fixes typo
eduardoformiga 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 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
150 changes: 150 additions & 0 deletions
150
src/components/sections/ProductGallery/product-gallery.scss
This file contains 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,150 @@ | ||
@import "../../../styles/scaffold.scss"; | ||
|
||
.product-listing { | ||
padding-top: 0; | ||
--product-listing-row-height: var(--space-6); | ||
|
||
@include media(">=notebook") { | ||
padding-top: var(--page-padding-notebook); | ||
} | ||
} | ||
|
||
// Temporary till we have skeletons. | ||
.product-listing__data-loading { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
padding-top: var(--space-5); | ||
} | ||
|
||
.product-listing__content-grid { | ||
display: flex; | ||
flex-direction: column; | ||
padding-right: 0; | ||
padding-left: 0; | ||
|
||
@include media(">=notebook") { | ||
display: grid; | ||
grid-template-rows: var(--product-listing-row-height) auto; | ||
grid-template-columns: repeat(12, 1fr); | ||
padding-right: var(--page-padding-notebook); | ||
padding-left: var(--page-padding-notebook); | ||
column-gap: var(--space-4); | ||
row-gap: var(--space-0); | ||
} | ||
} | ||
|
||
.product-listing__filters { | ||
@include media(">=notebook") { | ||
position: sticky; | ||
top: var(--grid-gap-0); | ||
grid-row: span 2; | ||
grid-column: 1 / span 3; | ||
align-self: start; | ||
} | ||
} | ||
|
||
.product-listing__sort { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
order: 1; | ||
width: 100%; | ||
min-height: rem(68px); | ||
padding: var(--space-1) var(--space-3) var(--space-2); | ||
background-color: var(--bg-neutral-lightest); | ||
|
||
@include media(">=notebook") { | ||
grid-column: 6 / span 7; | ||
justify-content: flex-end; | ||
order: unset; | ||
min-height: initial; | ||
padding: 0; | ||
} | ||
} | ||
|
||
.product-listing__results-count { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
order: 2; | ||
min-height: rem(45px); | ||
padding: var(--space-2) var(--space-3); | ||
background-color: var(--bg-neutral-light); | ||
|
||
@include media(">=notebook") { | ||
grid-column: 4 /span 2; | ||
justify-content: left; | ||
order: unset; | ||
min-height: initial; | ||
padding: 0; | ||
background-color: unset; | ||
} | ||
} | ||
|
||
.product-listing__results { | ||
--padding: var(--space-1); | ||
|
||
order: 3; | ||
padding: var(--padding) var(--padding) 0; | ||
background-color: var(--bg-neutral-light); | ||
|
||
@include media(">=notebook") { | ||
grid-column: 4 / span 9; | ||
order: unset; | ||
padding: 0; | ||
background-color: unset; | ||
} | ||
|
||
.product-card[data-store-card] { min-width: 100%; } | ||
} | ||
|
||
.product-listing__results-sponsored { | ||
margin: var(--space-1) calc(-1 * var(--padding)); | ||
padding: var(--space-4) var(--space-3); | ||
background-color: var(--bg-neutral-lightest); | ||
|
||
@include media(">=notebook") { | ||
margin: var(--space-6) 0; | ||
padding: 0; | ||
|
||
[data-store-tiles] { | ||
column-gap: var(--grid-gap-0); | ||
row-gap: 0; | ||
} | ||
} | ||
|
||
h3 { margin-bottom: var(--space-1); } | ||
} | ||
|
||
.product-listing__pagination { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
min-height: var(--space-13); | ||
margin-right: calc(-1 * var(--padding)); | ||
margin-left: calc(-1 * var(--padding)); | ||
padding: var(--space-4); | ||
background-color: var(--bg-neutral-lightest); | ||
|
||
@include media(">=notebook") { | ||
padding: var(--space-1) var(--space-2); | ||
} | ||
|
||
&--top { | ||
margin-bottom: var(--padding); | ||
} | ||
|
||
&--bottom { | ||
margin-top: var(--padding); | ||
} | ||
|
||
[data-store-button] { | ||
width: 100%; | ||
|
||
@include media(">=notebook") { | ||
width: fit-content; | ||
} | ||
} | ||
} |
This file contains 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,13 +1,17 @@ | ||
import type { ElementType } from 'react' | ||
import React from 'react' | ||
|
||
import './sr-only.scss' | ||
|
||
interface Props { | ||
text: string | ||
as?: ElementType | ||
} | ||
|
||
function SROnly({ text }: Props) { | ||
return <span data-store-sr-only>{text}</span> | ||
function SROnly({ text, as }: Props) { | ||
const Component = as ?? 'span' | ||
|
||
return <Component data-store-sr-only>{text}</Component> | ||
} | ||
|
||
export default SROnly |
This file contains 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 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
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.
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.
In the future we can rename it to a more generic meaning to cover this case (when we need to hide information but not necessary related to screen reader only) 👍