Skip to content

Commit

Permalink
refactor: rename "product" to "video" (foyzulkarim#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
aninda052 committed Aug 3, 2023
1 parent d3ec0ee commit 37ca124
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions client/src/pages/ProductsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -42,7 +42,7 @@ export default function ProductsPage() {
</Stack>
</Stack>

<ProductList products={PRODUCTS} />
<VideoList videos={PRODUCTS} />
<ProductCartWidget />
</Container>
</>
Expand Down
22 changes: 0 additions & 22 deletions client/src/sections/@dashboard/products/ProductList.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 22 additions & 0 deletions client/src/sections/@dashboard/products/VideoList.js
Original file line number Diff line number Diff line change
@@ -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 (
<Grid container spacing={3} {...other}>
{videos.map((video) => (
<Grid key={video.id} item xs={12} sm={6} md={3}>
<VideoCard video={video} />
</Grid>
))}
</Grid>
);
}
4 changes: 2 additions & 2 deletions client/src/sections/@dashboard/products/index.js
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit 37ca124

Please sign in to comment.