From 37ca124d167ee405e205542c393d24c6e54e8726 Mon Sep 17 00:00:00 2001 From: aninda052 Date: Thu, 27 Jul 2023 02:40:07 +0600 Subject: [PATCH] refactor: rename "product" to "video" (#28) --- client/src/pages/ProductsPage.js | 4 ++-- .../@dashboard/products/ProductList.js | 22 ------------------- .../products/{ProductCard.js => VideoCard.js} | 6 ++--- .../sections/@dashboard/products/VideoList.js | 22 +++++++++++++++++++ .../src/sections/@dashboard/products/index.js | 4 ++-- 5 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 client/src/sections/@dashboard/products/ProductList.js rename client/src/sections/@dashboard/products/{ProductCard.js => VideoCard.js} (94%) create mode 100644 client/src/sections/@dashboard/products/VideoList.js diff --git a/client/src/pages/ProductsPage.js b/client/src/pages/ProductsPage.js index f9568ff..b779597 100644 --- a/client/src/pages/ProductsPage.js +++ b/client/src/pages/ProductsPage.js @@ -3,7 +3,7 @@ import { useState } from 'react'; // @mui import { Container, Stack, Typography } from '@mui/material'; // components -import { ProductSort, ProductList, ProductCartWidget, ProductFilterSidebar } from '../sections/@dashboard/products'; +import { ProductSort, VideoList, ProductCartWidget, ProductFilterSidebar } from '../sections/@dashboard/products'; // mock import PRODUCTS from '../_mock/products'; @@ -42,7 +42,7 @@ export default function ProductsPage() { - + diff --git a/client/src/sections/@dashboard/products/ProductList.js b/client/src/sections/@dashboard/products/ProductList.js deleted file mode 100644 index 1494145..0000000 --- a/client/src/sections/@dashboard/products/ProductList.js +++ /dev/null @@ -1,22 +0,0 @@ -import PropTypes from 'prop-types'; -// @mui -import { Grid } from '@mui/material'; -import ShopProductCard from './ProductCard'; - -// ---------------------------------------------------------------------- - -ProductList.propTypes = { - products: PropTypes.array.isRequired, -}; - -export default function ProductList({ products = [], ...other }) { - return ( - - {products.map((product) => ( - - - - ))} - - ); -} diff --git a/client/src/sections/@dashboard/products/ProductCard.js b/client/src/sections/@dashboard/products/VideoCard.js similarity index 94% rename from client/src/sections/@dashboard/products/ProductCard.js rename to client/src/sections/@dashboard/products/VideoCard.js index 46a743f..3ffd0c2 100644 --- a/client/src/sections/@dashboard/products/ProductCard.js +++ b/client/src/sections/@dashboard/products/VideoCard.js @@ -21,11 +21,11 @@ const StyledProductImg = styled('img')({ // ---------------------------------------------------------------------- -ShopProductCard.propTypes = { - product: PropTypes.object, +VideoCard.propTypes = { + video: PropTypes.object, }; -export default function ShopProductCard({ video }) { +export default function VideoCard({ video }) { const { title: name, thumbnailUrl: cover, diff --git a/client/src/sections/@dashboard/products/VideoList.js b/client/src/sections/@dashboard/products/VideoList.js new file mode 100644 index 0000000..f4b19ca --- /dev/null +++ b/client/src/sections/@dashboard/products/VideoList.js @@ -0,0 +1,22 @@ +import PropTypes from 'prop-types'; +// @mui +import { Grid } from '@mui/material'; +import VideoCard from './VideoCard'; + +// ---------------------------------------------------------------------- + +VideoList.propTypes = { + videos: PropTypes.array.isRequired, +}; + +export default function VideoList({ videos = [], ...other }) { + return ( + + {videos.map((video) => ( + + + + ))} + + ); +} diff --git a/client/src/sections/@dashboard/products/index.js b/client/src/sections/@dashboard/products/index.js index 43784e1..5a7e980 100644 --- a/client/src/sections/@dashboard/products/index.js +++ b/client/src/sections/@dashboard/products/index.js @@ -1,5 +1,5 @@ -export { default as ProductCard } from './ProductCard'; -export { default as ProductList } from './ProductList'; +export { default as VideoCard } from './VideoCard'; +export { default as VideoList } from './VideoList'; export { default as ProductSort } from './ProductSort'; export { default as ProductCartWidget } from './ProductCartWidget'; export { default as ProductFilterSidebar } from './ProductFilterSidebar';