-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dataTable): fix the skeleton of datatable (#2332)
* fix(datable): update the datatbale and detail skeleton closes2307 * fix(datable): update the datatbale and detail skeleton closes2307 * fix(datable): update the datatbale and detail skeleton closes2307
- Loading branch information
1 parent
91f4ad2
commit 065961f
Showing
9 changed files
with
69 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/geoview-core/src/core/components/data-table/data-skeleton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { useTheme } from '@mui/material/styles'; | ||
import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Paper, Skeleton } from '@/ui'; | ||
|
||
/** | ||
* Custom data table skeleton build with table and mui skelton | ||
* @returns {JSX.Element} | ||
*/ | ||
export default function DataSkeleton(): JSX.Element { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<TableContainer component={Paper}> | ||
<Table> | ||
<TableHead> | ||
<TableRow> | ||
{[...Array(5).keys()].map((value) => ( | ||
<TableCell sx={{ width: '20%' }} key={value}> | ||
<Skeleton variant="text" width="100%" height="25px" sx={{ bgcolor: theme.palette.grey[400] }} /> | ||
</TableCell> | ||
))} | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{[...Array(6).keys()].map((row) => ( | ||
<TableRow key={row} sx={{ '&:last-child td, &:last-child th': { border: 0 } }}> | ||
{[...Array(5).keys()].map((value) => ( | ||
<TableCell sx={{ width: '20%' }} key={value}> | ||
<Skeleton variant="text" width="100%" height="25px" sx={{ bgcolor: theme.palette.grey[400] }} /> | ||
</TableCell> | ||
))} | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/geoview-core/src/core/components/details/details-skeleton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Box, Skeleton } from '@/ui'; | ||
|
||
/** | ||
* Custom details skeleton build with mui skeleton component. | ||
* @returns {JSX.Element} | ||
*/ | ||
export default function DetailsSkeleton(): JSX.Element { | ||
const sizes = ['15%', '10%', '15%', '25%', '10%', '20%', '10%']; | ||
return ( | ||
<Box padding={8}> | ||
<Box pb={8}> | ||
{sizes.map((size, index) => ( | ||
<Box display="flex" justifyContent="space-between" pt={4} pb={4} key={`${index.toString()}-${size}}`}> | ||
<Skeleton variant="text" width={size} height="25px" /> | ||
<Skeleton variant="text" width={size} height="25px" /> | ||
</Box> | ||
))} | ||
</Box> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters