From a56a2f55331f629d328e34df209a488210794634 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Mon, 26 Oct 2020 23:22:27 -0300 Subject: [PATCH 01/14] Changes --- components/auth/ForgotPassword.tsx | 16 ---------------- .../cart/CartSidebarView/CartSidebarView.tsx | 4 ++-- components/core/Footer/Footer.module.css | 9 +++++++++ components/core/Footer/Footer.tsx | 6 ++++-- 4 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 components/core/Footer/Footer.module.css diff --git a/components/auth/ForgotPassword.tsx b/components/auth/ForgotPassword.tsx index f6e342742..261c171af 100644 --- a/components/auth/ForgotPassword.tsx +++ b/components/auth/ForgotPassword.tsx @@ -1,9 +1,7 @@ import { FC, useEffect, useState, useCallback } from 'react' import { validate } from 'email-validator' -import { Info } from '@components/icons' import { useUI } from '@components/ui/context' import { Logo, Button, Input } from '@components/ui' -import useSignup from '@bigcommerce/storefront-data-hooks/dist/use-signup' interface Props {} @@ -15,7 +13,6 @@ const ForgotPassword: FC = () => { const [dirty, setDirty] = useState(false) const [disabled, setDisabled] = useState(false) - const signup = useSignup() const { setModalView, closeModal } = useUI() const handleSignup = async () => { @@ -23,19 +20,6 @@ const ForgotPassword: FC = () => { setDirty(true) handleValidation() } - - // try { - // setLoading(true) - // setMessage('') - // await signup({ - // email, - // }) - // setLoading(false) - // closeModal() - // } catch ({ errors }) { - // setMessage(errors[0].message) - // setLoading(false) - // } } const handleValidation = useCallback(() => { diff --git a/components/cart/CartSidebarView/CartSidebarView.tsx b/components/cart/CartSidebarView/CartSidebarView.tsx index 8f019494b..0c8a2db3f 100644 --- a/components/cart/CartSidebarView/CartSidebarView.tsx +++ b/components/cart/CartSidebarView/CartSidebarView.tsx @@ -2,7 +2,7 @@ import { FC } from 'react' import cn from 'classnames' import { UserNav } from '@components/core' import { Button } from '@components/ui' -import { ArrowLeft, Bag, Cross, Check } from '@components/icons' +import { Bag, Cross, Check } from '@components/icons' import { useUI } from '@components/ui/context' import useCart from '@bigcommerce/storefront-data-hooks/dist/cart/use-cart' import usePrice from '@bigcommerce/storefront-data-hooks/dist/use-price' @@ -47,7 +47,7 @@ const CartSidebarView: FC = () => { aria-label="Close panel" className="hover:text-gray-500 transition ease-in-out duration-150" > - +
diff --git a/components/core/Footer/Footer.module.css b/components/core/Footer/Footer.module.css new file mode 100644 index 000000000..259318ecf --- /dev/null +++ b/components/core/Footer/Footer.module.css @@ -0,0 +1,9 @@ +.link { + & > svg { + @apply transform duration-75 ease-linear; + } + + &:hover > svg { + @apply scale-110; + } +} diff --git a/components/core/Footer/Footer.tsx b/components/core/Footer/Footer.tsx index 419de5ccc..b4472c287 100644 --- a/components/core/Footer/Footer.tsx +++ b/components/core/Footer/Footer.tsx @@ -7,7 +7,7 @@ import getSlug from '@utils/get-slug' import { Github } from '@components/icons' import { Logo, Container } from '@components/ui' import { I18nWidget } from '@components/core' - +import s from './Footer.module.css' interface Props { className?: string children?: any @@ -83,7 +83,9 @@ const Footer: FC = ({ className, pages }) => {
- + + +
From d79ddb07febae19b02982a83ea24520453b502fe Mon Sep 17 00:00:00 2001 From: B Date: Mon, 26 Oct 2020 23:38:06 -0300 Subject: [PATCH 02/14] Update README.md --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a586199d2..6f1330d9c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,32 @@ # Next.js Commerce +The all-in-one starter kit for high-performance ecommerce sites. With a few clicks, Next.js developers can clone, deploy, and fully customize it. +Start right now at nextjs.org/commerce. -## Features +Demo live at: https://commerce-demo.vercel.app/ -## Todo +This project is currently under development. + +## Why +Ecommerce is one of the most important uses of the web and together we can raise the standard for ecommerce sites. + +## Goals and Features +- Performant by default +- SEO Ready +- Internationalization +- Responsive +- UI Components +- Theming +- Standarized Data Hooks +- Integrations - Integrate seamlessly with the most common ecommerce platforms. ## Contribute +Our Commitment to Open Source can be found [here](https://vercel.com/oss). + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device. +2. Create a new branch `git checkout -b MY_BRANCH_NAME` +3. Install yarn: `npm install -g yarn` +4. Install the dependencies: `yarn` +5. Run `yarn dev` to build and watch for code changes +7. The development branch is `development` (this is the branch pull requests should be made against). +On a release, the relevant parts of the changes in the `staging` branch are rebased into `master`. + From 1c454f35ec512e57721317d5ceb0eb8734a20259 Mon Sep 17 00:00:00 2001 From: B Date: Mon, 26 Oct 2020 23:39:33 -0300 Subject: [PATCH 03/14] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f1330d9c..54ebd4793 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Next.js Commerce The all-in-one starter kit for high-performance ecommerce sites. With a few clicks, Next.js developers can clone, deploy, and fully customize it. -Start right now at nextjs.org/commerce. +Start right now at [nextjs.org/commerce](https://nextjs.org/commerce) -Demo live at: https://commerce-demo.vercel.app/ +Demo live at: [commerce-demo.vercel.app](https://commerce-demo.vercel.app/) This project is currently under development. From a4941ad67873c6a29ec17e26c6b40988f6899d98 Mon Sep 17 00:00:00 2001 From: Martin Bavio Date: Mon, 26 Oct 2020 23:42:45 -0300 Subject: [PATCH 04/14] Add support for dynamic flags images and alts --- components/core/I18nWidget/I18nWidget.tsx | 38 ++++++++++++++++++---- public/flag-en-us.svg | 1 + public/flag-es.svg | 1 + public/flag-us.png | Bin 762 -> 0 bytes 4 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 public/flag-en-us.svg create mode 100644 public/flag-es.svg delete mode 100644 public/flag-us.png diff --git a/components/core/I18nWidget/I18nWidget.tsx b/components/core/I18nWidget/I18nWidget.tsx index 132553f7f..31f2db76f 100644 --- a/components/core/I18nWidget/I18nWidget.tsx +++ b/components/core/I18nWidget/I18nWidget.tsx @@ -6,21 +6,47 @@ import { Menu } from '@headlessui/react' import { DoubleChevron } from '@components/icons' import s from './I18nWidget.module.css' -const LOCALES_MAP: Record = { - es: 'Español', - 'en-US': 'English', +interface LOCALE_DATA { + name: string + img: { + filename: string + alt: string + } +} + +const LOCALES_MAP: Record = { + es: { + name: 'Español', + img: { + filename: 'flag-es.svg', + alt: 'Bandera española', + }, + }, + 'en-US': { + name: 'English', + img: { + filename: 'flag-en-us.svg', + alt: 'US Flag', + }, + }, } const I18nWidget: FC = () => { const { locale, locales, defaultLocale = 'en-US' } = useRouter() const options = locales?.filter((val) => val !== locale) + const currentLocale = locale || defaultLocale + return (