Skip to content
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

Feature/corrections-home-header-footer #18

Open
wants to merge 117 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
da17577
feat: virtualConsultant
Apr 9, 2022
2e60239
feat: montserrat
Apr 9, 2022
cde7ffa
fix: storeId temporary
Apr 9, 2022
0213ab0
fix: body color temporary
Apr 9, 2022
61a0acd
Merge branch 'base' into feature/productPage
Apr 9, 2022
0a0abb8
feat: add incentives header
yapondjian Apr 9, 2022
75430df
fix cms webhook url
valentino-amadeus Apr 8, 2022
f364529
update CHANGELOG.md
valentino-amadeus Apr 8, 2022
33ce002
feat: incentives header n top links
yapondjian Apr 9, 2022
d6f0416
feat: homeHero
JKAmadio Apr 9, 2022
bf6cdee
feat: homeMosaico
JKAmadio Apr 9, 2022
9fd54d2
feat: homeNewsletter
JKAmadio Apr 10, 2022
641d18d
feat: homeNewProducts
JKAmadio Apr 10, 2022
d585a21
feat: homeBannerPromocional
JKAmadio Apr 10, 2022
79f1ed0
feat: homeFavoriteProducts
JKAmadio Apr 10, 2022
5fd0d90
Merge pull request #4 from vtex-sites/feature/homeFavoriteProducts
JKAmadio Apr 10, 2022
6e126b1
feat: pdp
Apr 10, 2022
6d2bfca
fix: thumbor url temporary
Apr 10, 2022
d031f6b
feat: desktop menu
yapondjian Apr 11, 2022
8eb18fc
feat: desktop header row
yapondjian Apr 11, 2022
b5b4972
Merge branch 'base' into feature/productPage
Apr 12, 2022
1a88f1f
fix: retorno storeId
JKAmadio Apr 12, 2022
a066c20
feat: mobile header
yapondjian Apr 12, 2022
dffd039
fix: desktop account link
yapondjian Apr 12, 2022
b21512a
feat: productCard desktop
marcilioreis Apr 12, 2022
0253b9c
fix: virtualConsultant
Apr 12, 2022
bd187fb
Merge branch 'feat/virtualconsultant' into base
Apr 12, 2022
9ffb3ba
feat: minicart
yapondjian Apr 12, 2022
c579df6
feat: about - page creation
JKAmadio Apr 10, 2022
5b5274f
feat: about:headerBanner
JKAmadio Apr 10, 2022
32fb0ad
feat: about:aboutDescription
JKAmadio Apr 10, 2022
0e9678f
fix: svg color
yapondjian Apr 12, 2022
3b218fc
fix: mobile search
yapondjian Apr 12, 2022
b92d70f
fix: svg icons
yapondjian Apr 12, 2022
b45cb00
feature: home mobile version
JKAmadio Apr 12, 2022
b8dd176
feat: home shelf
marcilioreis Apr 12, 2022
c796c09
fix: remove cms render
yapondjian Apr 12, 2022
83f92b4
merge
yapondjian Apr 12, 2022
e80c272
fix: buttons layout
yapondjian Apr 12, 2022
bebe7d1
feat footer
Apr 12, 2022
6d84b97
feat: adjusts in filter styles
farosilva Apr 12, 2022
796577b
fix: spaces
yapondjian Apr 12, 2022
639b2cf
fix: newsletter mobile
yapondjian Apr 12, 2022
2c09fb2
Merge branch 'base' of https://github.com/vtex-sites/toys.store into …
farosilva Apr 12, 2022
138051a
feat: adjusts in ordenation and load more
farosilva Apr 12, 2022
b36c040
feat: mobile
Apr 12, 2022
a785455
merge/footer
yapondjian Apr 13, 2022
d6439eb
fix: footer image size
yapondjian Apr 13, 2022
fc470f0
feat: adjusts styles in load more button
farosilva Apr 13, 2022
697612f
fix: desktop newsletter padding
yapondjian Apr 13, 2022
aa65002
fix: footer copy rights
yapondjian Apr 13, 2022
84348a5
feat: shelf carousel
marcilioreis Apr 13, 2022
c46134c
add background
yapondjian Apr 13, 2022
73f1e00
merge background
yapondjian Apr 13, 2022
3143cbc
fix: hero banner
yapondjian Apr 13, 2022
c579210
fix: Virtual Consultant
yapondjian Apr 13, 2022
e9d7aa8
fix: ligthhouse
yapondjian Apr 13, 2022
ef6ee31
fix: virtual consultant
yapondjian Apr 13, 2022
5a3013e
fix store-config pages
yapondjian Apr 13, 2022
76601b0
feat: slider center
marcilioreis Apr 13, 2022
615619a
fix: ProductImage carousel
Apr 13, 2022
50cc9c7
Merge branch 'feature/productPage' of https://github.com/vtex-sites/t…
yapondjian Apr 13, 2022
7201f4e
fix: carouselCustom
Apr 13, 2022
aaf7754
fix: duplicate array images
yapondjian Apr 13, 2022
2a9b2c9
fix: erros skills
yapondjian Apr 13, 2022
ff71fec
merge: category
yapondjian Apr 13, 2022
3b3d6cc
feat: show category
yapondjian Apr 13, 2022
4fe9526
merge: product card
yapondjian Apr 13, 2022
fb5a556
fix: VirtualConsultant icon & Incentives carousel
Apr 13, 2022
3552870
Merge branch 'merge/product' of https://github.com/vtex-sites/toys.st…
yapondjian Apr 13, 2022
417b0ea
fix: VirtualConsultant icon & Incentives carousel
Apr 13, 2022
5d5afbf
feature: add image at HeaderBanner
JKAmadio Apr 13, 2022
5d595ae
feature: add margin to newsletter
JKAmadio Apr 13, 2022
c75f59c
feature: add header on Category
JKAmadio Apr 13, 2022
7ec2e56
Merge branch 'feature/completeAbout' of https://github.com/vtex-sites…
yapondjian Apr 13, 2022
d7b8f3f
fix: hide departament option
yapondjian Apr 13, 2022
00e83d7
fix: breadcrumb
yapondjian Apr 13, 2022
2d2fca7
fix: QA home - links
JKAmadio Apr 13, 2022
63959aa
fix: home Remove this commented out code
yapondjian Apr 13, 2022
8e44806
fix: lighthouse
Apr 13, 2022
798c2ce
fix: QA home - border-radius
JKAmadio Apr 13, 2022
0c529c0
feat: adjusts in "saiba mais"
farosilva Apr 13, 2022
c4e53cc
feat: change text in section
farosilva Apr 13, 2022
8cfddd5
fix: QA footer
JKAmadio Apr 13, 2022
96e6a99
feat: fix section cutted
farosilva Apr 13, 2022
69a69c1
fix: performance & accessibility
Apr 13, 2022
7185fb1
fix: shelf li
marcilioreis Apr 13, 2022
531e4b7
fix: menu style & menu align
Apr 13, 2022
9cfb780
feat: added newsletter component
farosilva Apr 13, 2022
e7d1ed4
fix: remove font Lato
Apr 13, 2022
addd17e
fix: font capitalize menu
Apr 13, 2022
29d5b69
fix: remove font Lato
Apr 13, 2022
d47b8e0
feat: adjusts in description for mobile
farosilva Apr 13, 2022
955d285
fix: category mobile
yapondjian Apr 13, 2022
d15bdd7
fix: mobile search
yapondjian Apr 13, 2022
75d3c00
fix: minicart
Apr 13, 2022
66567fe
feat: adjusts in buy-button
farosilva Apr 13, 2022
00b2861
feat: adjusts in styles for price
farosilva Apr 13, 2022
f0cbb3c
Merge branch 'merge/category' of https://github.com/vtex-sites/toys.s…
farosilva Apr 13, 2022
2e412a8
feat: adjusts in listPrice on productCards
farosilva Apr 13, 2022
68e9e46
Merge branch 'fix/homeQA' of https://github.com/vtex-sites/toys.store…
yapondjian Apr 13, 2022
d1347fe
Merge branch 'fix/footerQA' of https://github.com/vtex-sites/toys.sto…
yapondjian Apr 13, 2022
0cbca19
merge product card
yapondjian Apr 13, 2022
6fc9b01
fix: lighthouse
yapondjian Apr 13, 2022
e56b24c
Merge branch 'fix/minicart' of https://github.com/vtex-sites/toys.sto…
yapondjian Apr 13, 2022
fd37f87
Merge branch 'fix/productQA' of https://github.com/vtex-sites/toys.st…
yapondjian Apr 13, 2022
49519ea
feat: added container for "Who buys, buy too"
farosilva Apr 13, 2022
49e0dcf
Merge branch 'merge/category' of https://github.com/vtex-sites/toys.s…
farosilva Apr 13, 2022
7146156
fix: accessibility & performance
Apr 13, 2022
77ee9ca
Merge branch 'fix/productQA' into develop
farosilva Apr 13, 2022
959d656
fix: qa maravilhoso
Apr 13, 2022
155dc69
feature: fevorite products carrousel
JKAmadio Apr 13, 2022
3fb0591
Merge branch 'feature/favoriteCarrousel' of https://github.com/vtex-s…
JKAmadio Apr 13, 2022
a9c6ace
fix: lazy eager
Apr 13, 2022
260d747
fix: remove comments from layout
JKAmadio Apr 13, 2022
862b856
fix: VirtualConsultant
Apr 13, 2022
4f85a37
fix: correct logo
Apr 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cypress/integration/performance.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ describe('React rendering performance', () => {
}
})

it('Renders Alert component once', () => {
const mark = 'Alert'
// it('Renders Alert component once', () => {
// const mark = 'Alert'

for (const path of paths) {
testMark(path, mark)
}
})
// for (const path of paths) {
// testMark(path, mark)
// }
// })

it('Renders Page component once', () => {
const mark = 'Page'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@faststore/api": "^1.6.26",
"@faststore/sdk": "^1.6.26",
"@faststore/ui": "^1.6.26",
"@reach/router": "^1.3.4",
"@vtex/gatsby-plugin-nginx": "^1.6.26",
"@vtex/gatsby-source-cms": "^0.2.4",
"@vtex/gatsby-source-store": "^1.6.26",
Expand Down Expand Up @@ -103,4 +104,4 @@
"stylelint --fix"
]
}
}
}
23 changes: 14 additions & 9 deletions src/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
import React, { lazy, Suspense } from 'react'
import Alert from 'src/components/common/Alert'
import React, { lazy, Suspense, useEffect } from 'react'
import Footer from 'src/components/common/Footer'
import Navbar from 'src/components/common/Navbar'
import Toast from 'src/components/common/Toast'
import { useUI } from 'src/sdk/ui'
import type { PropsWithChildren } from 'react'
import { useLocation } from '@reach/router'

const CartSidebar = lazy(() => import('src/components/cart/CartSidebar'))

function Layout({ children }: PropsWithChildren<unknown>) {
const { displayMinicart } = useUI()

const { pathname } = useLocation()

useEffect(() => {
if (pathname === '/') {
document.querySelector('body')?.classList.remove('notHome')
document.querySelector('body')?.classList.add('home')
} else {
document.querySelector('body')?.classList.remove('home')
document.querySelector('body')?.classList.add('notHome')
}
})

return (
<div id="layout">
<Alert>
Get 10% off today:&nbsp;<span>NEW10</span>
</Alert>

<Navbar />

<main>{children}</main>

<Footer />

<Toast />

{displayMinicart && (
<Suspense fallback={null}>
<CartSidebar />
Expand Down
31 changes: 12 additions & 19 deletions src/components/cart/CartItem/CartItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Card, CardActions, CardContent, CardImage } from '@faststore/ui'
import React from 'react'
import Button from 'src/components/ui/Button'
import Icon from 'src/components/ui/Icon'
import { Image } from 'src/components/ui/Image'
import Price from 'src/components/ui/Price'
import QuantitySelector from 'src/components/ui/QuantitySelector'
Expand Down Expand Up @@ -30,8 +29,8 @@ function CartItem({ item }: Props) {
<Image
src={item.itemOffered.image[0].url}
alt={item.itemOffered.image[0].alternateName}
width={72}
height={72}
width={95}
height={95}
/>
</CardImage>
<div data-cart-item-summary>
Expand Down Expand Up @@ -59,23 +58,17 @@ function CartItem({ item }: Props) {
/>
</span>
</div>
<CardActions>
<Button variant="tertiary" iconPosition="left" {...btnProps}>
remover
</Button>
<QuantitySelector
min={1}
initial={item.quantity}
onChange={(quantity) => updateItemQuantity(item.id, quantity)}
/>
</CardActions>
</CardContent>

<CardActions>
<Button
variant="tertiary"
icon={<Icon name="XCircle" width={18} height={18} />}
iconPosition="left"
{...btnProps}
>
Remove
</Button>
<QuantitySelector
min={1}
initial={item.quantity}
onChange={(quantity) => updateItemQuantity(item.id, quantity)}
/>
</CardActions>
</Card>
)
}
Expand Down
51 changes: 41 additions & 10 deletions src/components/cart/CartItem/cart-item.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@import "src/styles/scaffold";

.cart-item {
padding: var(--space-3);
background-color: var(--bg-neutral-lightest);
border: var(--border-width-0) solid var(--color-border-display);
border-radius: var(--border-radius-default);
padding: var(--space-4) var(--space-5) var(--space-4) var(--space-3);
border-bottom: var(--border-width-0) solid var(--color-gray-transparent);

@include media("<notebook") {
padding: 27px 33px 27px 21px;
}

[data-card-content] {
display: grid;
grid-template-columns: rem(72px) repeat(4, 1fr);
display: flex;
align-items: center;
column-gap: var(--grid-gap-0);
}

[data-gatsby-image-wrapper] {
Expand All @@ -22,26 +22,57 @@
[data-cart-item-summary] {
flex-direction: column;
grid-column: 2 / span 4;
max-width: 171px;
margin: 0 12px 0 22px;

@include media("<notebook") {
margin: 0 6px 0 12px;
}
}

[data-cart-item-title] {
margin-bottom: var(--space-0);
color: inherit;
// margin-bottom: var(--space-0);
margin-bottom: 31px;
font-size: 14px;
line-height: 1.2;
color: #333056;
text-decoration: none;
outline: none;

@include truncate-title;
}

[data-card-image] {
display: block;
width: 95px;
}

[data-cart-item-prices] {
display: flex;
align-items: baseline;
}

[data-card-actions] {
display: flex;
flex-direction: column;
justify-content: space-between;
margin-top: var(--space-3);

button[data-testid="remove-from-cart-button"] {
width: auto;
height: auto;
margin-bottom: 26px;
font-size: 14px;
font-weight: 400;
line-height: 20px;
color: #333056;
text-decoration-line: underline;
letter-spacing: 0.01em;
background-color: transparent;
border: 0;
}
}

[data-store-quantity-selector] {
width: 103px;
}
}
21 changes: 13 additions & 8 deletions src/components/cart/CartSidebar/CartSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { List } from '@faststore/ui'
import React, { useRef } from 'react'
import Alert from 'src/components/ui/Alert'
import { Badge } from 'src/components/ui/Badge'
import Button from 'src/components/ui/Button'
import Icon from 'src/components/ui/Icon'
Expand Down Expand Up @@ -37,22 +36,22 @@ function CartSidebar() {
>
<header data-testid="cart-sidebar">
<div className="cart-sidebar__title">
<p className="title-display">Your Cart</p>
<IconButton
aria-label="Cart title"
icon={<Icon name="ShoppingCart" width={25} height={25} />}
/>
<p className="title-display">Seu carrinho</p>
<Badge variant="info" small>
{totalItems}
</Badge>
</div>
<IconButton
data-testid="cart-sidebar-button-close"
aria-label="Close Cart"
icon={<Icon name="X" width={32} height={32} />}
icon={<Icon name="X" width={35} height={35} />}
onClick={() => dismissTransition.current?.()}
/>
</header>
<Alert icon={<Icon name="Truck" width={24} height={24} />}>
Free shipping starts at $300
</Alert>

{isEmpty ? (
<EmptyCart onDismiss={() => dismissTransition.current?.()} />
) : (
Expand Down Expand Up @@ -81,10 +80,16 @@ function CartSidebar() {
iconPosition="right"
{...btnProps}
>
{isValidating ? 'Loading...' : 'Checkout'}
{isValidating ? 'Loading...' : 'finalizar o pedido'}
</Button>
}
/>
<IconButton
data-testid="cart-sidebar-button-close"
aria-label="continuar comprando"
icon={<Icon name="X" width={35} height={35} />}
onClick={() => dismissTransition.current?.()}
/>
</footer>
</>
)}
Expand Down
68 changes: 63 additions & 5 deletions src/components/cart/CartSidebar/cart-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,81 @@
flex-direction: column;
height: 100%;
overflow: auto;
background-color: var(--bg-neutral-light);
background-color: rgb(255 255 255 / 80%);

> header {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-2) var(--page-padding-phone) var(--space-2);
background-color: var(--bg-neutral-lightest);
padding: var(--space-5) var(--page-padding-phone) var(--space-5);
color: var(--color-primary-4);
background-color: var(--color-white-transparent-9);

@include media("<notebook") {
padding: 29px 25px;
}

> [data-store-icon-button] {
&:last-of-type {
margin-right: calc(-1 * var(--space-1));
color: var(--color-primary-4);
}
}
}

.empty-state[data-empty-state] {
button {
color: var(--color-theme-2);
cursor: pointer;
border-color: var(--color-theme-2);
}
}

.cart-sidebar__title {
display: flex;
align-items: center;

button {
color: var(--color-theme-3);
}

p {
margin-right: var(--space-2);
font-size: var(--text-size-4);
font-weight: 500;
line-height: 1.35;
color: var(--color-theme-3);
}

[data-store-badge][data-store-badge="small"] {
display: flex;
align-items: center;
justify-content: center;
max-width: 27px;
padding: 2px 6px;
font-size: 12px;
font-weight: 400;
line-height: 15px;
background: #de68d1;
border-radius: 5px;
box-shadow: 0 1px 2px rgb(0 0 0 / 25%);

&::after {
content: attr(data-items);
}
}
}

> [data-store-list] {
display: flex;
flex-direction: column;
padding: var(--page-padding-phone);
overflow: auto;
row-gap: var(--space-2);
padding: 0;
margin: 10px 7px 0 0;
overflow: auto;
&::-webkit-scrollbar { width: 10px; }
&::-webkit-scrollbar-track { background: rgb(255 255 255 / 20%); }
&::-webkit-scrollbar-thumb { background-color: #fbfbfb; }
}

> footer {
Expand All @@ -45,5 +88,20 @@
[data-store-button] {
width: 100%;
}

[aria-label="continuar comprando"] {
svg {
display: none;
}

&::after {
display: block;
margin: 0 auto 22px;
font-size: 14px;
line-height: 17px;
color: var(--color-primary-4);
content: "continuar comprando";
}
}
}
}
2 changes: 1 addition & 1 deletion src/components/cart/CartToggle/CartToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function CartToggle() {
{...btnProps}
className="cart-toggle"
aria-label={`Cart with ${btnProps['data-items']} items`}
icon={<Icon name="ShoppingCart" width={32} height={32} />}
icon={<Icon name="ShoppingCart" width={17} height={17} />}
/>
)
}
Expand Down
Loading