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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FSSS-170] Chore: tweaks search page (#293)
* Removes unused title * Extracts css from product-gallery section * Tweaks SROnly component * Adds SROnly h1 title to search page * Fixes typo
- Loading branch information
1 parent
94344a5
commit b866a61
Showing
5 changed files
with
162 additions
and
155 deletions.
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