Skip to content

Commit

Permalink
feat: add loading of promotions
Browse files Browse the repository at this point in the history
  • Loading branch information
pooriaset committed Dec 9, 2024
1 parent 4074d3f commit 5732505
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 24 deletions.
5 changes: 0 additions & 5 deletions src/app/[locale]/(main)/(container)/categories/page.tsx

This file was deleted.

27 changes: 27 additions & 0 deletions src/app/[locale]/(main)/promotion-center/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Card, CardContent, Container } from '@mui/material';
import Header from './components/Header';
import { FC, ReactNode } from 'react';

interface LayoutProps {
children: ReactNode;
}

const Layout: FC<LayoutProps> = async ({ children }) => {
return (
<>
<Header />
<Container
maxWidth="xl"
sx={{
mt: -4,
}}
>
<Card variant="outlined">
<CardContent>{children}</CardContent>
</Card>
</Container>
</>
);
};

export default Layout;
19 changes: 19 additions & 0 deletions src/app/[locale]/(main)/promotion-center/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { VariableProductItemSkeleton } from '@/components/VariableProductItem';
import { Grid } from '@mui/material';
import React from 'react';

const loading = () => {
return (
<Grid container spacing={2}>
{new Array(6).fill(1).map((_item, index) => {
return (
<Grid key={index} item xs={12} md={6} lg={3} xl={2}>
<VariableProductItemSkeleton />
</Grid>
);
})}
</Grid>
);
};

export default loading;
19 changes: 1 addition & 18 deletions src/app/[locale]/(main)/promotion-center/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
import { Card, CardContent, Container } from '@mui/material';
import Header from './components/Header';

const page = async () => {
return (
<>
<Header />
<Container
maxWidth="xl"
sx={{
mt: -4,
}}
>
<Card variant="outlined">
<CardContent></CardContent>
</Card>
</Container>
</>
);
return <></>;
};

export default page;
1 change: 0 additions & 1 deletion src/components/Header/components/BottomSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const BottomSection = () => {

const pages = [
{ label: t('header.navigation.products'), href: '/search' },
{ label: t('header.navigation.categories'), href: '/categories' },
{
label: t('header.navigation.bestSelling'),
href: `/search?sort=${bestSellingSortOption.key}`,
Expand Down

0 comments on commit 5732505

Please sign in to comment.