diff --git a/components/core/Layout/Layout.tsx b/components/core/Layout/Layout.tsx index e3d0e02b8..216ce4f74 100644 --- a/components/core/Layout/Layout.tsx +++ b/components/core/Layout/Layout.tsx @@ -4,16 +4,15 @@ import s from './Layout.module.css' import { Navbar, Featurebar, Footer } from '@components/core' import { Container, Sidebar } from '@components/ui' import { CartSidebarView } from '@components/cart' -import { UIProvider, useUI } from '@components/ui/context' +import { useUI } from '@components/ui/context' + import { CommerceProvider } from '@lib/bigcommerce' -import { ThemeProvider } from 'next-themes' -import { SSRProvider, OverlayProvider } from 'react-aria' interface Props { className?: string children?: any } -const CoreLayout: FC = ({ className, children }) => { +const Layout: FC = ({ className, children }) => { const rootClassName = cn(s.root, className) const { displaySidebar, closeSidebar } = useUI() @@ -35,16 +34,4 @@ const CoreLayout: FC = ({ className, children }) => { ) } -const Layout: FC = (props) => ( - - - - - - - - - -) - export default Layout diff --git a/components/product/ProductCard/ProductCard.module.css b/components/product/ProductCard/ProductCard.module.css index b8329a94f..1c9b2a75f 100644 --- a/components/product/ProductCard/ProductCard.module.css +++ b/components/product/ProductCard/ProductCard.module.css @@ -6,31 +6,31 @@ @apply scale-75; } - & .productTitle, + & .productTitle > span, & .productPrice, & .wishlistButton { @apply bg-secondary text-secondary; } - &:nth-child(6n + 1) .productTitle, + &:nth-child(6n + 1) .productTitle > span, &:nth-child(6n + 1) .productPrice, &:nth-child(6n + 1) .wishlistButton { @apply bg-violet text-white; } - &:nth-child(6n + 5) .productTitle, + &:nth-child(6n + 5) .productTitle > span, &:nth-child(6n + 5) .productPrice, &:nth-child(6n + 5) .wishlistButton { @apply bg-blue text-white; } - &:nth-child(6n + 3) .productTitle, + &:nth-child(6n + 3) .productTitle > span, &:nth-child(6n + 3) .productPrice, &:nth-child(6n + 3) .wishlistButton { @apply bg-pink text-white; } - &:nth-child(6n + 6) .productTitle, + &:nth-child(6n + 6) .productTitle > span, &:nth-child(6n + 6) .productPrice, &:nth-child(6n + 6) .wishlistButton { @apply bg-cyan text-white; @@ -66,29 +66,13 @@ } .productTitle { - /* @apply p-3 h-14 bg-primary text-base font-bold text-xl truncate leading-8 inline-flex; */ - /* max-width: calc(100% - 50px); */ - line-height: 1.3; - padding: 2px 0; - border-left: 20px solid #c0c; - width: 400px; - margin: 20px auto; + line-height: 51px; + width: 200px; - & h2 { - background-color: #c0c; - padding: 4px 0; - color: #fff; - display: inline; - margin: 0; - - & .strong { - position: relative; - left: -10px; - } - } - - @screen lg { - @apply text-2xl; + & span { + @apply inline text-2xl leading-6 p-4 bg-primary text-primary font-bold; + box-decoration-break: clone; + -webkit-box-decoration-break: clone; } } diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index 2637b8a76..2bb3e149a 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -46,17 +46,11 @@ const ProductCard: FC = ({ className, node: p, variant }) => {
-
-
- -

- {p.name} -

-
-
-
-
${p.prices.price.value}
+
+
+ {p.name}
+ ${p.prices.price.value}
diff --git a/components/ui/context.tsx b/components/ui/context.tsx index 40ac823b1..90fe8de94 100644 --- a/components/ui/context.tsx +++ b/components/ui/context.tsx @@ -1,4 +1,6 @@ import React, { FC } from 'react' +import { ThemeProvider } from 'next-themes' +import { SSRProvider, OverlayProvider } from 'react-aria' export interface State { displaySidebar: boolean @@ -63,3 +65,13 @@ function uiReducer(state: State, action: Action) { } } } + +export const ManagedUIContext: FC = ({ children }) => ( + + + + {children} + + + +) diff --git a/lib/commerce/cart/use-cart.tsx b/lib/commerce/cart/use-cart.tsx index bd1af710c..b65228553 100644 --- a/lib/commerce/cart/use-cart.tsx +++ b/lib/commerce/cart/use-cart.tsx @@ -18,7 +18,7 @@ export default function useCart( fetcherFn: HookFetcher, swrOptions?: ConfigInterface ) { - const { cartCookie } = useCommerce() + const { cartCookie = '' } = useCommerce() | {} const fetcher: typeof fetcherFn = (options, input, fetch) => { input.cartId = Cookies.get(cartCookie) return fetcherFn(options, input, fetch) diff --git a/pages/_app.tsx b/pages/_app.tsx index 683e07139..3d8dfc37c 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -3,9 +3,9 @@ import '@assets/tailwind.css' import '@assets/utils.css' import 'animate.css' import { FC } from 'react' - +import { Head } from '@components/core' import type { AppProps } from 'next/app' - +import { ManagedUIContext } from '@components/ui/context' import { CommerceProvider } from '@lib/bigcommerce' const Noop: FC = ({ children }) => <>{children} @@ -15,10 +15,13 @@ export default function MyApp({ Component, pageProps }: AppProps) { return ( <> + - - - + + + + + )