mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Merge branch 'master' of https://github.com/okbel/e-comm-example
This commit is contained in:
@@ -10,15 +10,15 @@ const ArrowLeft = ({ ...props }) => {
|
||||
>
|
||||
<path
|
||||
d="M19 12H5"
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M12 19L5 12L12 5"
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
|
@@ -10,9 +10,9 @@ const Check = ({ ...props }) => {
|
||||
>
|
||||
<path
|
||||
d="M20 6L9 17L4 12"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
|
@@ -4,9 +4,9 @@ const Minus = ({ ...props }) => {
|
||||
<path
|
||||
d="M5 12H19"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
|
@@ -4,16 +4,16 @@ const Plus = ({ ...props }) => {
|
||||
<path
|
||||
d="M12 5V19"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M5 12H19"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.5"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
)
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { NextSeo } from 'next-seo'
|
||||
import { FC, useState } from 'react'
|
||||
import type { ProductNode } from '@lib/bigcommerce/api/operations/get-product'
|
||||
import { Colors } from '@components/ui/types'
|
||||
import { useUI } from '@components/ui/context'
|
||||
import { Button, Container } from '@components/ui'
|
||||
import { Swatch, ProductSlider } from '@components/product'
|
||||
@@ -110,6 +109,7 @@ const ProductView: FC<Props> = ({ product, className }) => {
|
||||
label={v.label}
|
||||
onClick={() => {
|
||||
setChoices((choices) => {
|
||||
console.log(choices)
|
||||
return {
|
||||
...choices,
|
||||
[opt.displayName]: v.label,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
.root {
|
||||
@apply h-12 w-12 bg-primary text-primary rounded-full mr-3 inline-flex
|
||||
items-center justify-center cursor-pointer transition duration-100 ease-in-out
|
||||
p-0 shadow-none border-gray-200 border box-border;
|
||||
p-0 shadow-none border-gray-200 border box-border text-black;
|
||||
}
|
||||
|
||||
.active.size {
|
||||
|
@@ -1,10 +1,9 @@
|
||||
import cn from 'classnames'
|
||||
import { FC } from 'react'
|
||||
import s from './Swatch.module.css'
|
||||
import { Colors } from '@components/ui/types'
|
||||
import { Check } from '@components/icon'
|
||||
import Button, { ButtonProps } from '@components/ui/Button'
|
||||
|
||||
import { isDark } from '@lib/colors'
|
||||
interface Props {
|
||||
active?: boolean
|
||||
children?: any
|
||||
@@ -24,6 +23,7 @@ const Swatch: FC<Props & ButtonProps> = ({
|
||||
}) => {
|
||||
variant = variant?.toLowerCase()
|
||||
label = label?.toLowerCase()
|
||||
const isDarkBg = isDark(color)
|
||||
|
||||
const rootClassName = cn(
|
||||
s.root,
|
||||
@@ -43,8 +43,7 @@ const Swatch: FC<Props & ButtonProps> = ({
|
||||
{variant === 'color' && active && (
|
||||
<span
|
||||
className={cn('absolute', {
|
||||
'text-white': label !== 'white',
|
||||
'text-black': label === 'white',
|
||||
'text-white': isDarkBg,
|
||||
})}
|
||||
>
|
||||
<Check />
|
||||
|
Reference in New Issue
Block a user