diff --git a/components/cart/CartItem/CartItem.module.css b/components/cart/CartItem/CartItem.module.css index b6a8858b1..17715c7dc 100644 --- a/components/cart/CartItem/CartItem.module.css +++ b/components/cart/CartItem/CartItem.module.css @@ -1,6 +1,6 @@ .quantity { appearance: textfield; - @apply w-6 border-gray-300 border mx-3 rounded text-center text-sm; + @apply w-8 border-gray-300 border mx-3 rounded text-center text-sm; } .quantity::-webkit-outer-spin-button, diff --git a/components/cart/CartItem/CartItem.tsx b/components/cart/CartItem/CartItem.tsx index 4b4d0f01d..94fbff5c9 100644 --- a/components/cart/CartItem/CartItem.tsx +++ b/components/cart/CartItem/CartItem.tsx @@ -1,4 +1,4 @@ -import { Trash } from '@components/icon' +import { Trash, Plus, Minus } from '@components/icon' import { useCommerce } from '@lib/bigcommerce' import useUpdateItem from '@lib/bigcommerce/cart/use-update-item' import useRemoveItem from '@lib/bigcommerce/cart/use-remove-item' @@ -57,27 +57,29 @@ const CartItem = ({ }, [item.quantity]) return ( -
  • +
  • -
    +
    {item.name} -
    +
    -
    +
    {price}
    @@ -49,8 +49,8 @@ const CartSidebarView: FC = () => {
    ) : ( <> -
    -
      +
      +
        {items.map((item) => ( {
      -
      diff --git a/components/icon/ArrowLeft.tsx b/components/icon/ArrowLeft.tsx new file mode 100644 index 000000000..e85b956e6 --- /dev/null +++ b/components/icon/ArrowLeft.tsx @@ -0,0 +1,22 @@ +const ArrowLeft = ({ ...props }) => { + return ( + + + + + ) +} + +export default ArrowLeft diff --git a/components/icon/Minus.tsx b/components/icon/Minus.tsx new file mode 100644 index 000000000..48614cf2d --- /dev/null +++ b/components/icon/Minus.tsx @@ -0,0 +1,15 @@ +const Minus = ({ ...props }) => { + return ( + + + + ) +} + +export default Minus diff --git a/components/icon/Plus.tsx b/components/icon/Plus.tsx new file mode 100644 index 000000000..bb0da6b1f --- /dev/null +++ b/components/icon/Plus.tsx @@ -0,0 +1,22 @@ +const Plus = ({ ...props }) => { + return ( + + + + + ) +} + +export default Plus diff --git a/components/icon/index.ts b/components/icon/index.ts index 2afd43898..047be8be7 100644 --- a/components/icon/index.ts +++ b/components/icon/index.ts @@ -2,3 +2,6 @@ export { default as Bag } from './Bag' export { default as Heart } from './Heart' export { default as Trash } from './Trash' export { default as Cross } from './Cross' +export { default as ArrowLeft } from './ArrowLeft' +export { default as Plus } from './Plus' +export { default as Minus } from './Minus' diff --git a/components/ui/Button/Button.tsx b/components/ui/Button/Button.tsx index 55c9a157d..fbcaf0dac 100644 --- a/components/ui/Button/Button.tsx +++ b/components/ui/Button/Button.tsx @@ -16,6 +16,7 @@ export interface ButtonProps extends ButtonHTMLAttributes { active?: boolean type?: 'submit' | 'reset' | 'button' Component?: string | JSXElementConstructor + width?: string | number } const Button: React.FC = forwardRef((props, buttonRef) => { @@ -27,6 +28,7 @@ const Button: React.FC = forwardRef((props, buttonRef) => { active, onClick, disabled, + width, Component = 'button', ...rest } = props @@ -59,6 +61,9 @@ const Button: React.FC = forwardRef((props, buttonRef) => { ref={mergeRefs([ref, buttonRef])} {...rest} {...buttonProps} + style={{ + width, + }} data-active={isPressed ? '' : undefined} > {children} diff --git a/components/ui/Sidebar/Sidebar.tsx b/components/ui/Sidebar/Sidebar.tsx index cc14baf5b..c292eebc6 100644 --- a/components/ui/Sidebar/Sidebar.tsx +++ b/components/ui/Sidebar/Sidebar.tsx @@ -72,8 +72,8 @@ const Sidebar: FC = ({ className, children, show = true, close }) => { leaveFrom="translate-x-0" leaveTo="translate-x-full" > -
      -
      +
      +
      {children}