Update default shopify site design
This commit is contained in:
@@ -4,7 +4,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import ProductCard from './product-card';
|
||||
import { getProducts } from '@/hooks/use-shopify-products';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
import { Loader } from '@/components/ui/loader';
|
||||
|
||||
interface ProductImage {
|
||||
url: string;
|
||||
@@ -53,7 +53,7 @@ interface ProductsProps {
|
||||
}
|
||||
|
||||
const Products: React.FC<ProductsProps> = ({
|
||||
title = "Our Products",
|
||||
title = "Shop All",
|
||||
limit = 12,
|
||||
showLoadMore = true
|
||||
}) => {
|
||||
@@ -120,21 +120,17 @@ const Products: React.FC<ProductsProps> = ({
|
||||
return (
|
||||
<div className="py-16">
|
||||
<div className="container mx-auto px-4">
|
||||
<h2 className="text-4xl font-bold text-center mb-12 font-heading">
|
||||
<h2 className="text-4xl font-medium tracking-tight text-center mb-12 text-gray-900 font-heading">
|
||||
{title}
|
||||
</h2>
|
||||
|
||||
{/* Loading Skeleton */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8">
|
||||
{Array.from({ length: 8 }).map((_, index) => (
|
||||
<div key={index} className="bg-white rounded-lg shadow-md overflow-hidden animate-pulse">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
{Array.from({ length: 6 }).map((_, index) => (
|
||||
<div key={index} className="animate-pulse">
|
||||
<div className="aspect-square bg-gray-200"></div>
|
||||
<div className="p-6">
|
||||
<div className="h-6 bg-gray-200 rounded mb-2"></div>
|
||||
<div className="h-4 bg-gray-200 rounded mb-4"></div>
|
||||
<div className="h-8 bg-gray-200 rounded mb-4"></div>
|
||||
<div className="h-12 bg-gray-200 rounded"></div>
|
||||
</div>
|
||||
<div className="mt-3 h-4 w-2/3 bg-gray-200 rounded"></div>
|
||||
<div className="mt-2 h-4 w-1/4 bg-gray-200 rounded"></div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -147,13 +143,13 @@ const Products: React.FC<ProductsProps> = ({
|
||||
return (
|
||||
<div className="py-16">
|
||||
<div className="container mx-auto px-4 text-center">
|
||||
<h2 className="text-4xl font-bold mb-8 font-heading">
|
||||
<h2 className="text-4xl font-medium tracking-tight mb-8 text-gray-900 font-heading">
|
||||
{title}
|
||||
</h2>
|
||||
|
||||
<div className="bg-red-50 border border-red-200 rounded-lg p-8 max-w-md mx-auto">
|
||||
<div className="bg-red-50 border border-red-200 rounded-md p-8 max-w-md mx-auto">
|
||||
<i className="ri-error-warning-line text-4xl text-red-500 mb-4 block"></i>
|
||||
<h3 className="text-lg font-semibold text-red-800 mb-2">
|
||||
<h3 className="text-lg font-medium text-red-800 mb-2">
|
||||
Failed to Load Products
|
||||
</h3>
|
||||
<p className="text-red-600 mb-4">
|
||||
@@ -175,13 +171,13 @@ const Products: React.FC<ProductsProps> = ({
|
||||
return (
|
||||
<div className="py-16">
|
||||
<div className="container mx-auto px-4 text-center">
|
||||
<h2 className="text-4xl font-bold mb-8 font-heading">
|
||||
<h2 className="text-4xl font-medium tracking-tight mb-8 text-gray-900 font-heading">
|
||||
{title}
|
||||
</h2>
|
||||
|
||||
<div className="bg-gray-50 border border-gray-200 rounded-lg p-8 max-w-md mx-auto">
|
||||
<div className="bg-gray-50 border border-gray-200 rounded-md p-8 max-w-md mx-auto">
|
||||
<i className="ri-shopping-bag-line text-4xl text-gray-400 mb-4"></i>
|
||||
<h3 className="text-lg font-semibold text-gray-600 mb-2">
|
||||
<h3 className="text-lg font-medium text-gray-600 mb-2">
|
||||
No Products Found
|
||||
</h3>
|
||||
<p className="text-gray-500">
|
||||
@@ -196,12 +192,12 @@ const Products: React.FC<ProductsProps> = ({
|
||||
return (
|
||||
<div className="py-16">
|
||||
<div className="container mx-auto px-4">
|
||||
<h2 className="text-5xl font-bold text-center mb-16 text-gray-900 font-heading">
|
||||
<h2 className="text-4xl font-medium tracking-tight text-center mb-12 text-gray-900 font-heading">
|
||||
{title}
|
||||
</h2>
|
||||
|
||||
{/* Products Grid */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8 mb-12">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12">
|
||||
{products.map((product) => (
|
||||
<ProductCard
|
||||
key={product.id}
|
||||
@@ -222,7 +218,7 @@ const Products: React.FC<ProductsProps> = ({
|
||||
>
|
||||
{loadingMore ? (
|
||||
<span className="flex items-center space-x-2">
|
||||
<Spinner size="sm" />
|
||||
<Loader size={16} />
|
||||
<span>Loading...</span>
|
||||
</span>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user