Skip to content

Commit

Permalink
Update: Added nodemon and SwaggerJS
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangsonww committed Oct 20, 2024
1 parent d09de72 commit 07472a8
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 376 deletions.
Binary file removed build/android-chrome-192x192.png
Binary file not shown.
Binary file removed build/android-chrome-512x512.png
Binary file not shown.
Binary file removed build/apple-touch-icon.png
Binary file not shown.
15 changes: 0 additions & 15 deletions build/asset-manifest.json

This file was deleted.

Binary file removed build/favicon-16x16.png
Binary file not shown.
Binary file removed build/favicon-32x32.png
Binary file not shown.
Binary file removed build/favicon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion build/index.html

This file was deleted.

25 changes: 0 additions & 25 deletions build/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions build/robots.txt

This file was deleted.

2 changes: 0 additions & 2 deletions build/static/css/main.23cc7afe.css

This file was deleted.

1 change: 0 additions & 1 deletion build/static/css/main.23cc7afe.css.map

This file was deleted.

2 changes: 0 additions & 2 deletions build/static/js/999.0a44bdc0.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion build/static/js/999.0a44bdc0.chunk.js.map

This file was deleted.

206 changes: 0 additions & 206 deletions build/static/js/main.a9a0490a.js

This file was deleted.

114 changes: 0 additions & 114 deletions build/static/js/main.a9a0490a.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/static/js/main.a9a0490a.js.map

This file was deleted.

Binary file added src/assets/images/summer-sale.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/tech-gadgets.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/trending-fashion.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import * as React from 'react';
import { Typography, Grid, Box, Container, Button, CircularProgress, Alert, Paper, styled } from '@mui/material';
import Carousel from 'react-material-ui-carousel';
import ProductCard from '../components/ProductCard';
import summerSaleImage from '../assets/images/summer-sale.jpg';
import techGadgetsImage from '../assets/images/tech-gadgets.jpg';
import trendingFashionImage from '../assets/images/trending-fashion.jpg';

const StyledCarousel = styled(Carousel)({
'& .Carousel-indicators-container': {
Expand All @@ -23,17 +26,17 @@ const StyledCarousel = styled(Carousel)({
function Home({ products, addToCart, error, loading }) {
const bannerImages = [
{
url: 'https://thumbs.dreamstime.com/b/electronics-sale-banner-devices-online-shopping-delivery-basket-273419752.jpg',
url: summerSaleImage,
title: 'Summer Sale - Up to 50% Off',
description: 'Shop now for the best deals on summer essentials!',
},
{
url: 'https://magesolution.com/wp-content/uploads/2022/07/1_7u7eYPpkr5baaBOzYcdNHw.jpeg',
url: techGadgetsImage,
title: 'New Tech Gadgets',
description: 'Explore the latest in tech and gadgets.',
},
{
url: 'https://images.pexels.com/photos/3768005/pexels-photo-3768005.jpeg?cs=srgb&dl=pexels-willoworld-3768005.jpg&fm=jpg',
url: trendingFashionImage,
title: 'Trending Fashion',
description: 'Discover the newest fashion trends for this season.',
},
Expand All @@ -48,7 +51,7 @@ function Home({ products, addToCart, error, loading }) {
<StyledCarousel
animation="slide"
autoPlay={true}
interval={5000}
interval={2500}
navButtonsAlwaysVisible={true}
navButtonsProps={{
style: {
Expand Down
31 changes: 30 additions & 1 deletion src/pages/Shop.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import * as React from 'react';
import { Grid, Typography, Container, Box, FormControl, InputLabel, Select, MenuItem, Pagination } from '@mui/material';
import { Grid, Typography, Container, Box, FormControl, InputLabel, Select, MenuItem, Pagination, CircularProgress } from '@mui/material';
import ProductCard from '../components/ProductCard';

function Shop({ products, addToCart }) {
const [categoryFilter, setCategoryFilter] = React.useState('all');
const [page, setPage] = React.useState(1);
const [loading, setLoading] = React.useState(true); // Loading state
const itemsPerPage = 6;

React.useEffect(() => {
// Simulating an API call to fetch products
setTimeout(() => {
setLoading(false); // Set loading to false after data is loaded
}, 1000); // Adjust this timeout to match the actual API call duration
}, []);

const uniqueCategories = Array.from(new Set(products.map(product => product.category)));

const filteredProducts = categoryFilter === 'all' ? products : products.filter(product => product.category === categoryFilter);
Expand All @@ -26,6 +34,27 @@ function Shop({ products, addToCart }) {
setPage(1);
};

if (loading) {
return (
<Box
sx={{
position: 'fixed',
top: 0,
left: 0,
width: '100%',
height: '100%',
backgroundColor: 'rgba(255, 255, 255, 0.8)',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
zIndex: 1000,
}}
>
<CircularProgress />
</Box>
);
}

return (
<Container maxWidth="lg">
<Typography variant="h4" sx={{ my: 2 }}>
Expand Down

0 comments on commit 07472a8

Please sign in to comment.