final commit before execution

This commit is contained in:
2025-02-07 11:51:43 +02:00
parent fa272c636c
commit 58e7ed2f06
14 changed files with 473 additions and 196 deletions

View File

@@ -8,7 +8,6 @@ export default async function AuthLayout({
return (
<section className='relative w-full'>
<div className='flex h-screen items-center justify-center bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-brand-violet-400 to-brand-yellow-200'>
{/**/}
{children}
</div>
</section>

View File

@@ -3,9 +3,15 @@
import {useTranslations} from 'next-intl'
import CartItems from '@/components/pages/cart/items'
import useCartStore from '@/store/cart-store'
export default function Cart() {
const t = useTranslations('cart')
const {cartItems} = useCartStore()
const totalSum = cartItems.reduce(
(total, product) => total + parseFloat(product.price) * product.quantity,
0
)
// const subtotal = items.reduce(
// (total, item) => total + item.price * item.quantity,
@@ -26,6 +32,13 @@ export default function Cart() {
<div className='col text-right'>{t('amount')}</div>
</header>
<CartItems />
<footer className='my-8 flex border-y border-y-brand-violet py-4 text-xl'>
<div className='col'></div>
<div className='flex-none'>{t('total')}:</div>
<div className='col text-right font-bold'>
{totalSum.toFixed(2)} грн
</div>
</footer>
</section>
</div>
</div>