Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
add cart
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes committed Sep 20, 2021
1 parent c11c64c commit 8ad42af
Show file tree
Hide file tree
Showing 40 changed files with 3,149 additions and 145 deletions.
4 changes: 2 additions & 2 deletions __generated__/CollectionSearchQuery.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions __generated__/FullTextSearchQuery.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions __generated__/ValidateCartMutation.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react'
import { SessionProvider, UIProvider, CartProvider } from '@vtex/store-sdk'

import ErrorBoundary from './src/sdk/error/ErrorBoundary'
import Layout from './src/views/Layout'
import Layout from './src/sdk/views/Layout'
import TestProvider from './src/sdk/tests'
import { validateCart } from './src/sdk/cart/validate'
import { uiInitialState, uiActions, uiEffects } from './src/sdk/ui'
Expand Down
32 changes: 16 additions & 16 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ const {
const isProduction = ENV === 'production'
const siteUrl = isProduction ? URL : DEPLOY_PRIME_URL

// const unique = (x) => Array.from(new Set(x))
const unique = (x) => Array.from(new Set(x))

// const getSizes = (variants) =>
// unique(
// Object.values(variants)
// .flatMap((variant) =>
// variant.breakpoints.map((width) => [
// `${width}x${Math.ceil(width / variant.aspectRatio)}`,
// `${width}x${Math.floor(width / variant.aspectRatio)}`,
// ])
// )
// .flat()
// )
const getSizes = (variants) =>
unique(
Object.values(variants)
.flatMap((variant) =>
variant.breakpoints.map((width) => [
`${width}x${Math.ceil(width / variant.aspectRatio)}`,
`${width}x${Math.floor(width / variant.aspectRatio)}`,
])
)
.flat()
)

module.exports = {
siteMetadata: {
Expand Down Expand Up @@ -111,10 +111,10 @@ module.exports = {
isCI && !isNetlify
? 'http://thumbor.vtex.internal'
: 'http://thumbor.thumborize.me',
// ...((isProduction || isNetlify) && {
// basePath: '/assets',
// sizes: getSizes(images),
// }),
...((isProduction || isNetlify) && {
basePath: '/assets',
sizes: getSizes(images),
}),
},
},
{
Expand Down
Loading

0 comments on commit 8ad42af

Please sign in to comment.