diff --git a/app/collection/[slug]/page.tsx b/app/collection/[slug]/page.tsx index b56a170d0..274fe8241 100644 --- a/app/collection/[slug]/page.tsx +++ b/app/collection/[slug]/page.tsx @@ -17,7 +17,7 @@ export default async function ProductPage(props: { params: Promise<{ slug: strin
{category.description}
-
+
{products.map((product) => ( ))} diff --git a/app/layout.tsx b/app/layout.tsx index 440abeb15..7eeec14da 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,6 +2,7 @@ import { CartProvider } from 'components/cart/cart-context'; import { CheckoutProvider } from 'components/checkout/checkout-provider'; import Footer from 'components/layout/footer'; import { Navbar } from 'components/layout/navbar'; +import Subscriptions from 'components/layout/subscriptions'; import { NextAuthProvider } from 'components/next-session-provider'; import { WelcomeToast } from 'components/welcome-toast'; import { GeistSans } from 'geist/font/sans'; @@ -55,6 +56,7 @@ export default async function RootLayout({ children }: { children: ReactNode }) {children} + diff --git a/app/page.tsx b/app/page.tsx index e7f43a579..df8e6f1bc 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -15,8 +15,8 @@ import { getTranslations } from 'next-intl/server'; import Image from 'next/image'; import Link from 'next/link'; import { Suspense } from 'react'; -import Flowers from '../assets/images/fiori.png'; -import ManWild from '../assets/images/man-wild.png'; +import Bg1 from '../assets/images/slide-bg-01.webp'; +import Bg2 from '../assets/images/slide-bg-02.webp'; async function Products({ category }: { category: Category }) { const products: Product[] = await woocommerce.get('products', { @@ -32,23 +32,27 @@ async function ProductsByCategory() { return ( <> -
- +
+ +
{t('helpIA')}
{categories.map((category, index) => ( -
-
+
+
{category.name} + + {t('viewAll')} +
+
{[...Array(3)].map((_, i) => ( ))} @@ -58,13 +62,15 @@ async function ProductsByCategory() { {index === 1 && ( -
+ <>
- +
- {t('topProducts')} - -
+
+ {t('topProducts')} + +
+ )}
))} @@ -79,7 +85,7 @@ async function LatestPosts() { return (
{t('latestPosts')} -
+
{posts.map((post: any) => (
+
{[...Array(3)].map((_, i) => ( ))} @@ -117,7 +123,7 @@ export default async function HomePage() { +
{[...Array(3)].map((_, i) => ( ))} diff --git a/app/product/[name]/page.tsx b/app/product/[name]/page.tsx index ac4ba3b04..ae20c335c 100644 --- a/app/product/[name]/page.tsx +++ b/app/product/[name]/page.tsx @@ -3,8 +3,10 @@ import { notFound } from 'next/navigation'; import { AddToCart } from 'components/cart/add-to-cart'; import { Gallery } from 'components/product/gallery'; +import { ProductCard } from 'components/product/product-card'; import { ProductProvider } from 'components/product/product-context'; -import { ProductDescription } from 'components/product/product-description'; +import ProductSpecifications from 'components/product/product-specifications'; +import { ProductVariants } from 'components/product/product-variants'; import { VariantSelector } from 'components/product/variant-selector'; import Prose from 'components/prose'; import { HIDDEN_PRODUCT_TAG } from 'lib/constants'; @@ -12,7 +14,6 @@ import { Image } from 'lib/woocomerce/models/base'; import { Product, ProductVariations } from 'lib/woocomerce/models/product'; import { woocommerce } from 'lib/woocomerce/woocommerce'; import { getTranslations } from 'next-intl/server'; -import Link from 'next/link'; import { Suspense } from 'react'; export async function generateMetadata(props: { @@ -52,25 +53,9 @@ async function RelatedProducts({ product }: { product: Product }) { {relatedProducts.length > 0 && (

{t('relatedProducts')}

-
+
{relatedProducts.map((relatedProduct) => { - return ( - - {relatedProduct.name} -
-

{relatedProduct.name}

-
-
- - ); + return ; })}
@@ -116,8 +101,9 @@ export default async function ProductPage(props: { params: Promise<{ name: strin }} />
-
-
+
+

{product.name}

+
@@ -131,27 +117,30 @@ export default async function ProductPage(props: { params: Promise<{ name: strin }))} /> -
- {product.description ? ( - - ) : null} -
-
-

{product.name}

+
+

{product.name}

{variations && ( )} - - - - +
+ + + + +
+ {product.short_description ? ( + + ) : null} +
+ +
diff --git a/app/profile/layout.tsx b/app/profile/layout.tsx index 3f7c6596a..743f4a2ae 100644 --- a/app/profile/layout.tsx +++ b/app/profile/layout.tsx @@ -37,7 +37,7 @@ export default function ProfileLayout({ user }: { user: React.ReactNode }) {
- + {t('user.hi')} {customer.first_name}
diff --git a/assets/images/slide-bg-01.webp b/assets/images/slide-bg-01.webp new file mode 100644 index 000000000..9a4ac584a Binary files /dev/null and b/assets/images/slide-bg-01.webp differ diff --git a/assets/images/slide-bg-02.webp b/assets/images/slide-bg-02.webp new file mode 100644 index 000000000..75f5712e9 Binary files /dev/null and b/assets/images/slide-bg-02.webp differ diff --git a/components/carousel.tsx b/components/carousel.tsx index c84d8d023..09ba10329 100644 --- a/components/carousel.tsx +++ b/components/carousel.tsx @@ -18,7 +18,7 @@ export async function Carousel() { {carouselProducts.map((product, i) => (
  • +
    {products.map((product, index) => ( ))} diff --git a/components/layout/subscriptions.tsx b/components/layout/subscriptions.tsx new file mode 100644 index 000000000..802e34447 --- /dev/null +++ b/components/layout/subscriptions.tsx @@ -0,0 +1,47 @@ +import Link from 'next/link'; + +export default function Subscriptions() { + return ( +
    +

    Abbonamenti

    +
    + {/* Settimanale */} +
    +

    Settimanale

    +

    Abbonati per una settimana

    +

    4 w/€

    + + Iscriviti + +
    + {/* Mensile */} +
    +

    Mensile

    +

    Abbonati per un mese

    +

    10 m/€

    + + Iscriviti + +
    + {/* Annuale */} +
    +

    Annuale

    +

    Abbonati per un anno

    +

    100 y/€

    + + Iscriviti + +
    + {/* Luxury */} +
    +

    Luxury

    +

    Esperienza premium

    +

    20 m/€

    + + Iscriviti + +
    +
    +
    + ); +} diff --git a/components/product/gallery.tsx b/components/product/gallery.tsx index 6fd335317..545f22b56 100644 --- a/components/product/gallery.tsx +++ b/components/product/gallery.tsx @@ -21,7 +21,7 @@ export function Gallery({ images }: { images: { id: number; src: string; altText
    {images[imageIndex] && ( {images[imageIndex]?.altText + {product.description ? ( + + + + ) : null} + {product.sku ? ( + + SKU: {product.sku} + + ) : null} + + ); +} diff --git a/components/product/product-description.tsx b/components/product/product-variants.tsx similarity index 66% rename from components/product/product-description.tsx rename to components/product/product-variants.tsx index dc72df3cc..41e09bdf3 100644 --- a/components/product/product-description.tsx +++ b/components/product/product-variants.tsx @@ -1,10 +1,9 @@ 'use client'; import Price from 'components/price'; -import Prose from 'components/prose'; import { Product, ProductVariations } from 'lib/woocomerce/models/product'; import { useProduct } from './product-context'; -export function ProductDescription({ +export function ProductVariants({ product, variations }: { @@ -18,7 +17,7 @@ export function ProductDescription({ return ( <> -
    +
    - {product.short_description ? ( - - ) : null} ); } diff --git a/messages/en.json b/messages/en.json index 5bb0d70e5..32800466e 100644 --- a/messages/en.json +++ b/messages/en.json @@ -2,7 +2,8 @@ "HomePage": { "helpIA": "Buy with IA help", "topProducts": "Top products", - "latestPosts": "Latest posts" + "latestPosts": "Latest posts", + "viewAll": "View all" }, "ProductPage": { "buy": "Buy", diff --git a/messages/it.json b/messages/it.json index c47b8895e..c2bd01255 100644 --- a/messages/it.json +++ b/messages/it.json @@ -2,7 +2,8 @@ "HomePage": { "helpIA": "Guida all'acquisto con IA", "topProducts": "Prodotti più venduti", - "latestPosts": "Ultimi articoli" + "latestPosts": "Ultimi articoli", + "viewAll": "Vedi tutti" }, "ProductPage": { "buy": "Acquista",