diff --git a/components/auth/ForgotPassword.tsx b/components/auth/ForgotPassword.tsx index c7d507701..083a86649 100644 --- a/components/auth/ForgotPassword.tsx +++ b/components/auth/ForgotPassword.tsx @@ -1,6 +1,6 @@ import { FC, useEffect, useState, useCallback } from 'react' import { validate } from 'email-validator' -import { Info } from '@components/icon' +import { Info } from'@components/icons' import { useUI } from '@components/ui/context' import { Logo, Button, Input } from '@components/ui' import useSignup from '@lib/bigcommerce/use-signup' diff --git a/components/auth/LoginView.tsx b/components/auth/LoginView.tsx index 6ef767ce1..b9cb4cb63 100644 --- a/components/auth/LoginView.tsx +++ b/components/auth/LoginView.tsx @@ -60,11 +60,19 @@ const LoginView: FC = () => {
{message && ( -
{message}
+
+ {message}. Did you {` `} + setModalView('FORGOT_VIEW')} + > + forgot your password? + +
)} - + - +
Don't have an account? {` `} = () => { > Sign Up - +
) diff --git a/components/auth/SignUpView.tsx b/components/auth/SignUpView.tsx index a574cc963..f79ec5eb9 100644 --- a/components/auth/SignUpView.tsx +++ b/components/auth/SignUpView.tsx @@ -1,6 +1,6 @@ import { FC, useEffect, useState, useCallback } from 'react' import { validate } from 'email-validator' -import { Info } from '@components/icon' +import { Info } from '@components/icons' import { useUI } from '@components/ui/context' import { Logo, Button, Input } from '@components/ui' import useSignup from '@lib/bigcommerce/use-signup' @@ -59,7 +59,7 @@ const SignUpView: FC = () => { }, [handleValidation]) return ( -
+
@@ -72,13 +72,13 @@ const SignUpView: FC = () => { - - Info: Password must be longer than 7 chars and - include numbers. + + + {' '} + + Info: Passwords must be longer than 7 chars and + include numbers.{' '} +
- + Do you have an account? {` `} = { diff --git a/components/core/Layout/Layout.tsx b/components/core/Layout/Layout.tsx index 0c65b7b29..d409d5958 100644 --- a/components/core/Layout/Layout.tsx +++ b/components/core/Layout/Layout.tsx @@ -6,7 +6,7 @@ import { CommerceProvider } from '@lib/bigcommerce' import { CartSidebarView } from '@components/cart' import { Container, Sidebar, Button, Modal, Toast } from '@components/ui' import { Navbar, Featurebar, Footer } from '@components/core' -import { LoginView, SignUpView } from '@components/auth' +import { LoginView, SignUpView, ForgotPassword } from '@components/auth' import { useUI } from '@components/ui/context' import { usePreventScroll } from '@react-aria/overlays' import s from './Layout.module.css' @@ -74,6 +74,7 @@ const Layout: FC = ({ children, pageProps }) => { {modalView === 'LOGIN_VIEW' && } {modalView === 'SIGNUP_VIEW' && } + {modalView === 'FORGOT_VIEW' && } { - return ( - - - - ) -} - -export default Cross diff --git a/components/icon/ArrowLeft.tsx b/components/icons/ArrowLeft.tsx similarity index 100% rename from components/icon/ArrowLeft.tsx rename to components/icons/ArrowLeft.tsx diff --git a/components/icon/Bag.tsx b/components/icons/Bag.tsx similarity index 100% rename from components/icon/Bag.tsx rename to components/icons/Bag.tsx diff --git a/components/icon/Check.tsx b/components/icons/Check.tsx similarity index 100% rename from components/icon/Check.tsx rename to components/icons/Check.tsx diff --git a/components/icons/Cross.tsx b/components/icons/Cross.tsx new file mode 100644 index 000000000..27eaf54d6 --- /dev/null +++ b/components/icons/Cross.tsx @@ -0,0 +1,21 @@ +const Cross = ({ ...props }) => { + return ( + + + + + ) +} + +export default Cross diff --git a/components/icon/DoubleChevron.tsx b/components/icons/DoubleChevron.tsx similarity index 100% rename from components/icon/DoubleChevron.tsx rename to components/icons/DoubleChevron.tsx diff --git a/components/icon/Github.tsx b/components/icons/Github.tsx similarity index 100% rename from components/icon/Github.tsx rename to components/icons/Github.tsx diff --git a/components/icon/Heart.tsx b/components/icons/Heart.tsx similarity index 100% rename from components/icon/Heart.tsx rename to components/icons/Heart.tsx diff --git a/components/icon/Info.tsx b/components/icons/Info.tsx similarity index 100% rename from components/icon/Info.tsx rename to components/icons/Info.tsx diff --git a/components/icon/Minus.tsx b/components/icons/Minus.tsx similarity index 100% rename from components/icon/Minus.tsx rename to components/icons/Minus.tsx diff --git a/components/icon/Moon.tsx b/components/icons/Moon.tsx similarity index 100% rename from components/icon/Moon.tsx rename to components/icons/Moon.tsx diff --git a/components/icon/Plus.tsx b/components/icons/Plus.tsx similarity index 100% rename from components/icon/Plus.tsx rename to components/icons/Plus.tsx diff --git a/components/icon/RightArrow.tsx b/components/icons/RightArrow.tsx similarity index 100% rename from components/icon/RightArrow.tsx rename to components/icons/RightArrow.tsx diff --git a/components/icon/Sun.tsx b/components/icons/Sun.tsx similarity index 100% rename from components/icon/Sun.tsx rename to components/icons/Sun.tsx diff --git a/components/icon/Trash.tsx b/components/icons/Trash.tsx similarity index 100% rename from components/icon/Trash.tsx rename to components/icons/Trash.tsx diff --git a/components/icon/index.ts b/components/icons/index.ts similarity index 100% rename from components/icon/index.ts rename to components/icons/index.ts diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index c7b2c7aa2..60ebe5d03 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -3,7 +3,7 @@ import cn from 'classnames' import Link from 'next/link' import type { ProductNode } from '@lib/bigcommerce/api/operations/get-all-products' import usePrice from '@lib/bigcommerce/use-price' -import { Heart } from '@components/icon' +import { Heart } from '@components/icons' import { EnhancedImage } from '@components/core' import s from './ProductCard.module.css' diff --git a/components/product/ProductView/ProductView.tsx b/components/product/ProductView/ProductView.tsx index ae3f15d04..0c5caea80 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/components/product/ProductView/ProductView.tsx @@ -4,7 +4,7 @@ import Image from 'next/image' import { NextSeo } from 'next-seo' import s from './ProductView.module.css' -import { Heart } from '@components/icon' +import { Heart } from '@components/icons' import { useUI } from '@components/ui/context' import { Swatch, ProductSlider } from '@components/product' import { Button, Container } from '@components/ui' diff --git a/components/product/Swatch/Swatch.tsx b/components/product/Swatch/Swatch.tsx index e12421c41..30c9be7c3 100644 --- a/components/product/Swatch/Swatch.tsx +++ b/components/product/Swatch/Swatch.tsx @@ -1,7 +1,7 @@ import cn from 'classnames' import { FC } from 'react' import s from './Swatch.module.css' -import { Check } from '@components/icon' +import { Check } from '@components/icons' import Button, { ButtonProps } from '@components/ui/Button' import { isDark } from '@lib/colors' interface Props { diff --git a/components/ui/Hero/Hero.tsx b/components/ui/Hero/Hero.tsx index cb45350bc..2e1f124ae 100644 --- a/components/ui/Hero/Hero.tsx +++ b/components/ui/Hero/Hero.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react' import { Container } from '@components/ui' -import { RightArrow } from '@components/icon' +import { RightArrow } from '@components/icons' import s from './Hero.module.css' import Link from 'next/link' interface Props { diff --git a/components/ui/Modal/Modal.tsx b/components/ui/Modal/Modal.tsx index 623592039..e31e32e91 100644 --- a/components/ui/Modal/Modal.tsx +++ b/components/ui/Modal/Modal.tsx @@ -5,11 +5,12 @@ import { useDialog } from '@react-aria/dialog' import { FocusScope } from '@react-aria/focus' import { Transition } from '@headlessui/react' import { useOverlay, useModal, OverlayContainer } from '@react-aria/overlays' +import { Cross } from '@components/icons' interface Props { className?: string children?: any open?: boolean - onClose?: () => void + onClose: () => void } const Modal: FC = ({ @@ -26,7 +27,7 @@ const Modal: FC = ({ let { overlayProps } = useOverlay( { isOpen: open, - isDismissable: true, + isDismissable: false, onClose: onClose, ...props, }, @@ -53,6 +54,16 @@ const Modal: FC = ({ {...modalProps} ref={ref} > +
+ +
+ {children}
diff --git a/components/ui/context.tsx b/components/ui/context.tsx index 8110bf1e0..1c84b9de9 100644 --- a/components/ui/context.tsx +++ b/components/ui/context.tsx @@ -58,7 +58,7 @@ type Action = view: 'SIGNUP_VIEW' } -type MODAL_VIEWS = 'SIGNUP_VIEW' | 'LOGIN_VIEW' +type MODAL_VIEWS = 'SIGNUP_VIEW' | 'LOGIN_VIEW' | 'FORGOT_VIEW' type ToastText = string export const UIContext = React.createContext(initialState) diff --git a/components/wishlist/WishlistCard/WishlistCard.tsx b/components/wishlist/WishlistCard/WishlistCard.tsx index f257c2a8e..eeacfa779 100644 --- a/components/wishlist/WishlistCard/WishlistCard.tsx +++ b/components/wishlist/WishlistCard/WishlistCard.tsx @@ -1,5 +1,5 @@ import { FC } from 'react' -import { Trash } from '@components/icon' +import { Trash } from '@components/icons' import s from './WishlistCard.module.css' interface Props { diff --git a/pages/cart.tsx b/pages/cart.tsx index 4f62cc063..d9d669ab7 100644 --- a/pages/cart.tsx +++ b/pages/cart.tsx @@ -2,7 +2,7 @@ import { GetStaticPropsContext, InferGetStaticPropsType } from 'next' import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages' import { Layout } from '@components/core' import { Button } from '@components/ui' -import { Bag, Cross, Check } from '@components/icon' +import { Bag, Cross, Check } from '@components/icons' import useCart from '@lib/bigcommerce/cart/use-cart' import usePrice from '@lib/bigcommerce/use-price' import { CartItem } from '@components/cart'