File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
src/app/[locale]/(main)/categories Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1+ import { Skeleton , Stack } from '@mui/material' ;
2+ import React from 'react' ;
3+
4+ const Loading = ( ) => {
5+ return (
6+ < Stack direction = "row" alignItems = "flex-start" >
7+ < Skeleton width = { 115 } height = "100%" />
8+ < Stack px = { 1.5 } gap = { 1 } flexWrap = "wrap" direction = "row" flexGrow = { 1 } >
9+ { new Array ( 6 ) . fill ( 1 ) . map ( ( item ) => {
10+ return < Skeleton width = "30%" height = { 100 } /> ;
11+ } ) }
12+ </ Stack >
13+ </ Stack >
14+ ) ;
15+ } ;
16+
17+ export default Loading ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Stack } from '@mui/material';
77import { useEffect , useState } from 'react' ;
88import MenuCategoryItem from './components/MenuCategoryItem' ;
99import SubCategories from './components/SubCategories' ;
10+ import Loading from './loading' ;
1011
1112const page = ( ) => {
1213 const { data, loading } = useQuery < CategoriesQuery > (
@@ -28,8 +29,8 @@ const page = () => {
2829 }
2930 } , [ loading ] ) ;
3031
31- if ( loading || ! selected ) {
32- return < > Loading< /> ;
32+ if ( ! loading || ! selected ) {
33+ return < Loading /> ;
3334 }
3435
3536 return (
You can’t perform that action at this time.
0 commit comments