ProductGrid

This commit is contained in:
Belen Curcio
2020-10-01 17:25:48 -03:00
parent ba4b3b765c
commit de949095d7
21 changed files with 134 additions and 66 deletions

View File

@@ -0,0 +1,3 @@
.root {
@apply flex flex-row px-2;
}

View 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;

View File

@@ -0,0 +1 @@
export { default } from "./ProductCard";

View 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);
}

View 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;

View File

@@ -0,0 +1 @@
export { default } from "./ProductGrid";

View File

@@ -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;

View File

@@ -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;

View File

@@ -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";

View 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];
// };