mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
ProductGrid
This commit is contained in:
3
components/product/ProductCard/ProductCard.module.css
Normal file
3
components/product/ProductCard/ProductCard.module.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
@apply flex flex-row px-2;
|
||||
}
|
29
components/product/ProductCard/ProductCard.tsx
Normal file
29
components/product/ProductCard/ProductCard.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import cn from "classnames";
|
||||
import s from "./ProductCard.module.css";
|
||||
import React, { FunctionComponent } from "react";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
children?: any;
|
||||
}
|
||||
|
||||
const ProductCard: FunctionComponent<Props> = ({ className }) => {
|
||||
const rootClassName = cn(s.root, className);
|
||||
return (
|
||||
<div className={rootClassName}>
|
||||
<div className="absolute">
|
||||
<h1 className="px-8 py-2 bg-violet text-white font-bold text-3xl">
|
||||
{/* {productData.title} */}
|
||||
</h1>
|
||||
<div className="px-6 py-2 pb-4 bg-violet text-white font-semibold inline-block">
|
||||
{/* {productData.price} */}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-1 h-full p-24">
|
||||
<div className="bg-violet h-full"></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProductCard;
|
1
components/product/ProductCard/index.ts
Normal file
1
components/product/ProductCard/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from "./ProductCard";
|
4
components/product/ProductGrid/ProductGrid.module.css
Normal file
4
components/product/ProductGrid/ProductGrid.module.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.root {
|
||||
@apply grid grid-cols-1 lg:grid-cols-3 lg:grid-rows-4 w-full h-96;
|
||||
min-height: calc((100vh - 80px - 56px) * 2);
|
||||
}
|
25
components/product/ProductGrid/ProductGrid.tsx
Normal file
25
components/product/ProductGrid/ProductGrid.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import cn from "classnames";
|
||||
import React, { FunctionComponent } from "react";
|
||||
import s from "./ProductGrid.module.css";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
children?: any;
|
||||
products: [any];
|
||||
}
|
||||
|
||||
const ProductView: FunctionComponent<Props> = ({ products, className }) => {
|
||||
const rootClassName = cn(s.root, className);
|
||||
return (
|
||||
<div className={rootClassName}>
|
||||
<div className="row-span-2 lg:col-span-2 bg-violet h-full"></div>
|
||||
<div className="row-span-1 lg:col-span-1 bg-black h-full"></div>
|
||||
<div className="row-span-1 lg:col-span-1 bg-pink"></div>
|
||||
<div className="row-span-1 lg:col-span-1 bg-black h-full"></div>
|
||||
<div className="row-span-2 lg:col-span-2 bg-blue h-full"></div>
|
||||
<div className="row-span-1 lg:col-span-1 bg-cyan"></div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProductView;
|
1
components/product/ProductGrid/index.ts
Normal file
1
components/product/ProductGrid/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from "./ProductGrid";
|
@@ -3,14 +3,6 @@ import React, { FunctionComponent } from "react";
|
||||
import s from "./ProductView.module.css";
|
||||
import { Button } from "@components/ui";
|
||||
import { Swatch } from "@components/product";
|
||||
import { Colors } from "@components/types";
|
||||
interface ProductData {
|
||||
title: string;
|
||||
price: string;
|
||||
description: string;
|
||||
colors: [Colors];
|
||||
sizes: [string];
|
||||
}
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import cn from "classnames";
|
||||
import React, { FunctionComponent } from "react";
|
||||
import s from "./Swatch.module.css";
|
||||
import { Colors } from "@components/types";
|
||||
import { Colors } from "@components/ui/types";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
|
@@ -1,2 +1,4 @@
|
||||
export { default as ProductView } from "./ProductView";
|
||||
export { default as Swatch } from "./Swatch";
|
||||
export { default as ProductView } from "./ProductView";
|
||||
export { default as ProductCard } from "./ProductCard";
|
||||
export { default as ProductGrid } from "./ProductGrid";
|
||||
|
10
components/product/types.ts
Normal file
10
components/product/types.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Colors } from "@components/ui/types";
|
||||
export { Product } from "@lib/bigcommerce";
|
||||
|
||||
// export type ProductData = {
|
||||
// title: string;
|
||||
// price: string;
|
||||
// description: string;
|
||||
// colors: [Colors];
|
||||
// sizes: [string];
|
||||
// };
|
Reference in New Issue
Block a user