Merge branch 'master' of github.com:vercel/commerce into agnostic

This commit is contained in:
Belen Curcio 2021-01-07 10:36:54 -03:00
commit 7faea49da8
6 changed files with 126 additions and 88 deletions

12
assets/chrome-bug.css Normal file
View File

@ -0,0 +1,12 @@
/**
* Chrome has a bug with transitions on load since 2012!
*
* To prevent a "pop" of content, you have to disable all transitions until
* the page is done loading.
*
* https://lab.laukstein.com/bug/input
* https://twitter.com/timer150/status/1345217126680899584
*/
body.loading * {
transition: none !important;
}

View File

@ -2,7 +2,6 @@ import cn from 'classnames'
import s from './Marquee.module.css'
import { FC, ReactNode, Component } from 'react'
import Ticker from 'react-ticker'
import { useInView } from 'react-intersection-observer'
interface Props {
className?: string
@ -23,18 +22,12 @@ const Maquee: FC<Props> = ({
},
className
)
const [ref, inView] = useInView({
triggerOnce: true,
rootMargin: '200px 0px',
})
return (
<div className={rootClassName} ref={ref}>
{inView ? (
<Ticker offset={80}>
{() => <div className={s.container}>{children}</div>}
</Ticker>
) : null}
<div className={rootClassName}>
<Ticker offset={80}>
{() => <div className={s.container}>{children}</div>}
</Ticker>
</div>
)
}

View File

@ -57,13 +57,12 @@
"lodash.debounce": "^4.0.8",
"lodash.random": "^3.2.0",
"lodash.throttle": "^4.1.1",
"next": "^10.0.5-canary.3",
"next": "^10.0.5-canary.11",
"next-seo": "^4.11.0",
"next-themes": "^0.0.4",
"postcss-nesting": "^7.0.1",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-intersection-observer": "^8.30.1",
"react-merge-refs": "^1.1.0",
"react-ticker": "^1.2.2",
"swr": "^0.3.11",

View File

@ -1,7 +1,8 @@
import '@assets/main.css'
import 'keen-slider/keen-slider.min.css'
import '@assets/chrome-bug.css'
import { FC } from 'react'
import { FC, useEffect } from 'react'
import type { AppProps } from 'next/app'
import { ManagedUIContext } from '@components/ui/context'
@ -12,6 +13,10 @@ const Noop: FC = ({ children }) => <>{children}</>
export default function MyApp({ Component, pageProps }: AppProps) {
const Layout = (Component as any).Layout || Noop
useEffect(() => {
document.body.classList?.remove('loading')
}, [])
return (
<>
<Head />

23
pages/_document.tsx Normal file
View File

@ -0,0 +1,23 @@
import Document, {
DocumentContext,
Head,
Html,
Main,
NextScript,
} from 'next/document'
class MyDocument extends Document {
render() {
return (
<Html>
<Head />
<body className="loading">
<Main />
<NextScript />
</body>
</Html>
)
}
}
export default MyDocument

154
yarn.lock
View File

@ -60,14 +60,7 @@
dependencies:
tslib "~2.0.1"
"@babel/code-frame@7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a"
integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==
dependencies:
"@babel/highlight" "^7.10.4"
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.11":
"@babel/code-frame@7.12.11", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.11":
version "7.12.11"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"
integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==
@ -954,36 +947,37 @@
dependencies:
webpack-bundle-analyzer "3.6.1"
"@next/env@10.0.5-canary.3":
version "10.0.5-canary.3"
resolved "https://registry.yarnpkg.com/@next/env/-/env-10.0.5-canary.3.tgz#15e0797a0b6bdf139be286d42433b2fac79b7b88"
integrity sha512-egDdyGjnaRJR6Lo35cTilHj9lPvj1O+ibkPJANO8n/Yw/CnPNVBMN8qAkWr4ODxPWrg/F4w44HWyTmN4Upu0tA==
"@next/env@10.0.5-canary.11":
version "10.0.5-canary.11"
resolved "https://registry.yarnpkg.com/@next/env/-/env-10.0.5-canary.11.tgz#76daeda2bd0c9f040892f299864091c37c946bb9"
integrity sha512-afx6ECY9pqPLvVOteA1gi0pZ6CuLPSSx5QNyKX+m9v0sp+idEIjgFtghI+HU+hz7S9C7EP0kGw3wnY1/qdK0bw==
"@next/polyfill-module@10.0.5-canary.3":
version "10.0.5-canary.3"
resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-10.0.5-canary.3.tgz#e83aab134710c0057e6a181ed60fdf1e2e8bb2f5"
integrity sha512-QXM1aAwhnuBy7L6Zt2zYyUghHDpx3rT4za3cfE9v2WxikH74bM+A5GhgjHfu2DAKxhum1iOKsC3RfnUkpg3e1A==
"@next/polyfill-module@10.0.5-canary.11":
version "10.0.5-canary.11"
resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-10.0.5-canary.11.tgz#e6e53351b1bdd2ce619a4e29df191b1c8633d232"
integrity sha512-MWsioa2Kyx/p8kDsB0Y6fCley7/S8Z+vUG4ixUteR+OWibZSQrtqGs47lCJyfvdu69s75uzSlXNybbTWzcMguA==
"@next/react-dev-overlay@10.0.5-canary.3":
version "10.0.5-canary.3"
resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-10.0.5-canary.3.tgz#41ad91f400e4cde6f311b2bae9ad4f9b8dc9080b"
integrity sha512-pVPnSJ+2pCgzrAMUCIoyW5lQymxrvrGbczKl5VEr0AwLODYOFMwqFmV9F0SjvNsTEQPtrW7c4Z5/ylHOx52aKQ==
"@next/react-dev-overlay@10.0.5-canary.11":
version "10.0.5-canary.11"
resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-10.0.5-canary.11.tgz#c897d12eb0b1c8df065dc2a72ba7aeff5049b566"
integrity sha512-6Zt3wWhEVzGr9i8GUzCvDeY7qTb/u6Svnaan3uvY1cVtkghMa8qvGYqG45URecD8VhGBo9dI8Bnl9vYE4yj2wA==
dependencies:
"@babel/code-frame" "7.10.4"
ally.js "1.4.1"
"@babel/code-frame" "7.12.11"
anser "1.4.9"
chalk "4.0.0"
classnames "2.2.6"
data-uri-to-buffer "3.0.0"
css.escape "1.5.1"
data-uri-to-buffer "3.0.1"
platform "1.3.6"
shell-quote "1.7.2"
source-map "0.8.0-beta.0"
stacktrace-parser "0.1.10"
strip-ansi "6.0.0"
"@next/react-refresh-utils@10.0.5-canary.3":
version "10.0.5-canary.3"
resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-10.0.5-canary.3.tgz#d11a3bebe627e70e0ba87749cd129517daae4d03"
integrity sha512-dCi/j3n0x3xwg1smjpe+/BV9nXRlHD72bfgnuiYA/0Y00Oi+YzmdGiuaLh8tpjE4b6bQVT2XWas9V0HeV6s6jw==
"@next/react-refresh-utils@10.0.5-canary.11":
version "10.0.5-canary.11"
resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-10.0.5-canary.11.tgz#d3e885bfb0175f887adf4d927df0f6852a066a77"
integrity sha512-W/JNmDVnGeziaRkcCa94Oj0izOCWv4XGIKRNkTnQrtAWlZ1sIq5eijkJSJRphfBt9sShKUc90LOWCjtoEPpBwQ==
"@nodelib/fs.scandir@2.1.4":
version "2.1.4"
@ -1547,14 +1541,6 @@ ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
ally.js@1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/ally.js/-/ally.js-1.4.1.tgz#9fb7e6ba58efac4ee9131cb29aa9ee3b540bcf1e"
integrity sha1-n7fmuljvrE7pExyymqnuO1QLzx4=
dependencies:
css.escape "^1.5.0"
platform "1.3.3"
anser@1.4.9:
version "1.4.9"
resolved "https://registry.yarnpkg.com/anser/-/anser-1.4.9.tgz#1f85423a5dcf8da4631a341665ff675b96845760"
@ -1659,6 +1645,11 @@ array-flatten@1.1.1:
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=
array-flatten@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-3.0.0.tgz#6428ca2ee52c7b823192ec600fa3ed2f157cd541"
integrity sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==
array-union@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
@ -2029,7 +2020,7 @@ buffer-equal-constant-time@1.0.1:
resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819"
integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=
buffer-from@^1.0.0, buffer-from@^1.1.1:
buffer-from@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
@ -2356,7 +2347,7 @@ color-string@^1.5.4:
color-name "^1.0.0"
simple-swizzle "^0.2.2"
color@^3.1.2:
color@^3.1.2, color@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/color/-/color-3.1.3.tgz#ca67fb4e7b97d611dcde39eceed422067d91596e"
integrity sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==
@ -2609,7 +2600,7 @@ css-unit-converter@^1.1.1:
resolved "https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.2.tgz#4c77f5a1954e6dbff60695ecb214e3270436ab21"
integrity sha512-IiJwMC8rdZE0+xiEZHeru6YoONC4rfPMqGm2W85jMIbkFvv5nFTwJVFHam2eFrN6txmoUYFAFXiv8ICVeTO0MA==
css.escape@^1.5.0:
css.escape@1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb"
integrity sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=
@ -2675,12 +2666,10 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
data-uri-to-buffer@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.0.tgz#8a3088a5efd3f53c3682343313c6895d498eb8d7"
integrity sha512-MJ6mFTZ+nPQO+39ua/ltwNePXrfdF3Ww0wP1Od7EePySXN1cP9XNqRQOG3FxTfipp8jx898LUCgBCEP11Qw/ZQ==
dependencies:
buffer-from "^1.1.1"
data-uri-to-buffer@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636"
integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==
dataloader@2.0.0:
version "2.0.0"
@ -5209,18 +5198,18 @@ next-unused@^0.0.3:
madge "^3.8.0"
ts-loader "^7.0.0"
next@^10.0.5-canary.3:
version "10.0.5-canary.3"
resolved "https://registry.yarnpkg.com/next/-/next-10.0.5-canary.3.tgz#bfd292b5132d45cf40cbe15eb2ea997431853751"
integrity sha512-btVAhuIAEskOXJTpBv6dxLLPXYHRjc/v/7941c65gZFjBN7WR83RCwonNIqbsGYiYnO4weDkyTq6ltwOfy6nrQ==
next@^10.0.5-canary.11:
version "10.0.5-canary.11"
resolved "https://registry.yarnpkg.com/next/-/next-10.0.5-canary.11.tgz#f6c32b451a8fe179f917f19c1b5315501584d47f"
integrity sha512-RryLV/az0m+SyD1plzeRsE8G66gec2wp8jJoyaOUJCUjQdQK6sHgjwJB26KJcJFZskdbtUqbFvr05rw4eY0SAQ==
dependencies:
"@ampproject/toolbox-optimizer" "2.7.1-alpha.0"
"@babel/runtime" "7.12.5"
"@hapi/accept" "5.0.1"
"@next/env" "10.0.5-canary.3"
"@next/polyfill-module" "10.0.5-canary.3"
"@next/react-dev-overlay" "10.0.5-canary.3"
"@next/react-refresh-utils" "10.0.5-canary.3"
"@next/env" "10.0.5-canary.11"
"@next/polyfill-module" "10.0.5-canary.11"
"@next/react-dev-overlay" "10.0.5-canary.11"
"@next/react-refresh-utils" "10.0.5-canary.11"
"@opentelemetry/api" "0.14.0"
ast-types "0.13.2"
babel-plugin-transform-define "2.0.0"
@ -5261,7 +5250,7 @@ next@^10.0.5-canary.3:
webpack "4.44.1"
webpack-sources "1.4.3"
optionalDependencies:
sharp "0.26.2"
sharp "0.26.3"
no-case@^3.0.3, no-case@^3.0.4:
version "3.0.4"
@ -5720,10 +5709,10 @@ pkg-dir@^5.0.0:
dependencies:
find-up "^5.0.0"
platform@1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.3.tgz#646c77011899870b6a0903e75e997e8e51da7461"
integrity sha1-ZGx3ARiZhwtqCQPnXpl+jlHadGE=
platform@1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7"
integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==
pluralize@^8.0.0:
version "8.0.0"
@ -6170,10 +6159,10 @@ postcss@^7.0.11, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.18, postcss@^7.0
source-map "^0.6.1"
supports-color "^6.1.0"
prebuild-install@^5.3.5:
version "5.3.6"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-5.3.6.tgz#7c225568d864c71d89d07f8796042733a3f54291"
integrity sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==
prebuild-install@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.0.0.tgz#669022bcde57c710a869e39c5ca6bf9cd207f316"
integrity sha512-h2ZJ1PXHKWZpp1caLw0oX9sagVpL2YTk+ZwInQbQ3QqNd4J03O6MpFNmMTJlkfgPENWqe5kP0WjQLqz5OjLfsw==
dependencies:
detect-libc "^1.0.3"
expand-template "^2.0.3"
@ -6406,11 +6395,6 @@ react-dom@^16.14.0:
prop-types "^15.6.2"
scheduler "^0.19.1"
react-intersection-observer@^8.30.1:
version "8.30.1"
resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-8.30.1.tgz#e0ce4835d2834fc712b096aec65230de79eeaadb"
integrity sha512-BGHGkmWz/d4Gs+44jWkrZBtJ6//HGwouZ9ub+kRRoRfguw2JoDlVrgTDwkQ/deDJAR9keTkQmMilNu+onhqfgw==
react-is@16.13.1, react-is@^16.8.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
@ -6911,19 +6895,20 @@ sha.js@^2.4.0, sha.js@^2.4.8:
inherits "^2.0.1"
safe-buffer "^5.0.1"
sharp@0.26.2:
version "0.26.2"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.26.2.tgz#3d5777d246ae32890afe82a783c1cbb98456a88c"
integrity sha512-bGBPCxRAvdK9bX5HokqEYma4j/Q5+w8Nrmb2/sfgQCLEUx/HblcpmOfp59obL3+knIKnOhyKmDb4tEOhvFlp6Q==
sharp@0.26.3:
version "0.26.3"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.26.3.tgz#9de8577a986b22538e6e12ced1f7e8a53f9728de"
integrity sha512-NdEJ9S6AMr8Px0zgtFo1TJjMK/ROMU92MkDtYn2BBrDjIx3YfH9TUyGdzPC+I/L619GeYQc690Vbaxc5FPCCWg==
dependencies:
color "^3.1.2"
array-flatten "^3.0.0"
color "^3.1.3"
detect-libc "^1.0.3"
node-addon-api "^3.0.2"
npmlog "^4.1.2"
prebuild-install "^5.3.5"
prebuild-install "^6.0.0"
semver "^7.3.2"
simple-get "^4.0.0"
tar-fs "^2.1.0"
tar-fs "^2.1.1"
tunnel-agent "^0.6.0"
shell-quote@1.7.2:
@ -7340,7 +7325,7 @@ tapable@^2.1.1, tapable@^2.2.0:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b"
integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==
tar-fs@^2.0.0, tar-fs@^2.1.0:
tar-fs@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.0.tgz#d1cdd121ab465ee0eb9ccde2d35049d3f3daf0d5"
integrity sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg==
@ -7350,6 +7335,16 @@ tar-fs@^2.0.0, tar-fs@^2.1.0:
pump "^3.0.0"
tar-stream "^2.0.0"
tar-fs@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784"
integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==
dependencies:
chownr "^1.1.1"
mkdirp-classic "^0.5.2"
pump "^3.0.0"
tar-stream "^2.1.4"
tar-stream@^2.0.0:
version "2.1.4"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.4.tgz#c4fb1a11eb0da29b893a5b25476397ba2d053bfa"
@ -7361,6 +7356,17 @@ tar-stream@^2.0.0:
inherits "^2.0.3"
readable-stream "^3.1.1"
tar-stream@^2.1.4:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287"
integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==
dependencies:
bl "^4.0.3"
end-of-stream "^1.4.1"
fs-constants "^1.0.0"
inherits "^2.0.3"
readable-stream "^3.1.1"
temp@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60"