Skip to content

Commit

Permalink
styling product description
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammii-HK committed Apr 24, 2024
1 parent b828010 commit 7666a25
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
7 changes: 4 additions & 3 deletions @/components/ui/accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client"

import * as React from "react"
import * as AccordionPrimitive from "@radix-ui/react-accordion"
import { ChevronDown } from "lucide-react"
import * as React from "react"

import { cn } from "@/lib/utils"

Expand All @@ -14,7 +14,7 @@ const AccordionItem = React.forwardRef<
>(({ className, ...props }, ref) => (
<AccordionPrimitive.Item
ref={ref}
className={cn("border-b", className)}
className={cn("border-b border-neutral-600", className)}
{...props}
/>
))
Expand Down Expand Up @@ -57,4 +57,5 @@ const AccordionContent = React.forwardRef<
))
AccordionContent.displayName = AccordionPrimitive.Content.displayName

export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger }

2 changes: 1 addition & 1 deletion components/cart/add-to-cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function AddToCart({
});
}}
className={clsx(
'relative flex w-full items-center justify-center rounded bg-gray-600 p-4 tracking-wide text-white hover:opacity-90',
'relative flex w-full items-center justify-center rounded bg-neutral-800 p-4 tracking-wide text-white hover:opacity-90',
{
'cursor-not-allowed opacity-60': !availableForSale,
'cursor-not-allowed': isPending
Expand Down
2 changes: 1 addition & 1 deletion components/cart/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
</div>
<a
href={cart.checkoutUrl}
className="block w-full rounded bg-gray-600 p-3 text-center text-sm font-medium text-white opacity-90 hover:opacity-100"
className="block w-full rounded bg-neutral-600 p-3 text-center text-sm font-medium text-white opacity-90 hover:opacity-100"
>
Proceed to Checkout
</a>
Expand Down
2 changes: 1 addition & 1 deletion components/cart/open-cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function OpenCart({
/>

{quantity ? (
<div className="absolute right-0 top-0 -mr-2 -mt-2 h-4 w-4 rounded bg-gray-600 text-[11px] font-medium text-white">
<div className="absolute right-0 top-0 -mr-2 -mt-2 h-4 w-4 rounded bg-neutral-800 text-[11px] font-medium text-white">
{quantity}
</div>
) : null}
Expand Down
2 changes: 1 addition & 1 deletion components/product/product-description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function ProductDescription({ product }: { product: Product }) {
return (
<>
<div className="flex flex-col">
<h1 className="mb-2 text-2xl md:text-3xl font-medium">{product.title}</h1>
<h1 className="mb-2 text-xl sm:text-2xl md:text-3xl font-medium">{product.title}</h1>
</div>
<VariantDetails product={product} />
<AddToCart variants={product.variants} availableForSale={product.availableForSale} />
Expand Down
4 changes: 2 additions & 2 deletions components/product/variant-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export function VariantDetails({ product }: { product: Product }) {

return (
<>
<div className='flex flex-col border-b mb-6 dark:border-neutral-700'>
<div className="place-self-end mr-auto w-auto rounded bg-gray-600 p-2 text-sm text-white mb-6">
<div className='border-b mb-6 border-neutral-500 dark:border-neutral-700 display-flex justify-end'>
<div className="place-self-end justify-end mr-auto w-25 roundedp-2 text-sm text-neutral-300 mb-6">
<Price
amount={selectedVariant?.price?.amount || product.variants[0]!.price.amount}
currencyCode={product.priceRange.maxVariantPrice.currencyCode}
Expand Down
4 changes: 2 additions & 2 deletions components/product/variant-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ export function VariantSelector({
href={optionUrl}
title={`${option.name} ${value}${!isAvailableForSale ? ' (Out of Stock)' : ''}`}
className={clsx(
'flex min-w-[48px] items-center justify-center rounded border bg-neutral-777 px-2 py-1 text-sm dark:border-neutral-800 dark:bg-neutral-900',
'flex min-w-[48px] items-center justify-center rounded border border-neutral-600 px-2 py-1 text-sm text-neutral-200 dark:border-neutral-800 dark:bg-neutral-900',
{
'cursor-default ring-2 ring-gray-600': isActive,
'cursor-default ring-1 ring-gray-600 bg-neutral-300 text-neutral-900': isActive,
'ring-1 ring-transparent transition duration-300 ease-in-out hover:scale-110 hover:ring-gray-600 ':
!isActive && isAvailableForSale,
'relative z-10 cursor-not-allowed overflow-hidden bg-neutral-100 text-neutral-500 ring-1 ring-neutral-300 before:absolute before:inset-x-0 before:-z-10 before:h-px before:-rotate-45 before:bg-neutral-300 before:transition-transform dark:bg-neutral-900 dark:text-neutral-400 dark:ring-neutral-700 before:dark:bg-neutral-700':
Expand Down

0 comments on commit 7666a25

Please sign in to comment.