diff --git a/components/common/Layout/Layout.tsx b/components/common/Layout/Layout.tsx index 158f63068..14c07860a 100644 --- a/components/common/Layout/Layout.tsx +++ b/components/common/Layout/Layout.tsx @@ -6,11 +6,12 @@ import React, { FC } from 'react' import { useUI } from '@components/ui/context' import { Navbar, Footer } from '@components/common' import { useAcceptCookies } from '@lib/hooks/useAcceptCookies' -import { CommerceProvider } from '@bigcommerce/storefront-data-hooks' import { Sidebar, Button, Modal, LoadingDots } from '@components/ui' -import type { Page } from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages' import { CartSidebarView } from '@components/cart' +import { CommerceProvider } from '@bigcommerce/storefront-data-hooks' +import type { Page } from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages' + const Loading = () => (
@@ -76,7 +77,7 @@ const Layout: FC = ({ children, pageProps }) => { title="This site uses cookies to improve your experience. By clicking, you agree to our Privacy Policy." hide={acceptedCookies} action={ - } diff --git a/components/ui/Button/Button.tsx b/components/ui/Button/Button.tsx index e7f3d89c1..ca5db36a6 100644 --- a/components/ui/Button/Button.tsx +++ b/components/ui/Button/Button.tsx @@ -27,12 +27,12 @@ const Button: React.FC = forwardRef((props, buttonRef) => { variant = 'flat', children, active, - onClick, width, - Component = 'button', loading = false, disabled = false, style = {}, + Component = 'button', + ...rest } = props const ref = useRef(null) @@ -57,6 +57,7 @@ const Button: React.FC = forwardRef((props, buttonRef) => { width, ...style, }} + {...rest} > {children} {loading && ( diff --git a/lib/hooks/useAcceptCookies.ts b/lib/hooks/useAcceptCookies.ts index 2ba130abc..7f33adf47 100644 --- a/lib/hooks/useAcceptCookies.ts +++ b/lib/hooks/useAcceptCookies.ts @@ -1,5 +1,5 @@ -import { useEffect, useState } from 'react' import Cookies from 'js-cookie' +import { useEffect, useState } from 'react' const COOKIE_NAME = 'accept_cookies' @@ -14,9 +14,7 @@ export const useAcceptCookies = () => { const acceptCookies = () => { setAcceptedCookies(true) - Cookies.set(COOKIE_NAME, 'accepted', { - expires: 365, - }) + Cookies.set(COOKIE_NAME, 'accepted', { expires: 365 }) } return {