-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
118 additions
and
17 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
server/migrations/__pycache__/0002_alter_customers_house_number.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
85 changes: 75 additions & 10 deletions
85
src/components/ui/elements/skeleton/SkeletonProductCard.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 |
---|---|---|
@@ -1,14 +1,79 @@ | ||
import {FC} from 'react'; | ||
import React, { Fragment } from 'react' | ||
import ContentLoader from 'react-content-loader' | ||
|
||
import styles from './SkeletonCard.module.scss'; | ||
import ContentLoader from 'react-content-loader'; | ||
const SkeletonProductCard = ({ | ||
width = 1366, | ||
heading = { width: 140, height: 24 }, | ||
row = 2, | ||
column = 6, | ||
padding = 12, | ||
borderRadius = 4, | ||
...props | ||
}) => { | ||
const list = [] | ||
|
||
interface SkeletonCardProps {} | ||
let height | ||
|
||
const SkeletonProductCard: FC<SkeletonCardProps> = ({...props}) => { | ||
return ( | ||
|
||
); | ||
}; | ||
for (let i = 1; i <= row; i++) { | ||
for (let j = 0; j < column; j++) { | ||
const itemWidth = (width - padding * (column + 1)) / column | ||
|
||
export default SkeletonProductCard; | ||
const x = padding + j * (itemWidth + padding) | ||
|
||
const height1 = itemWidth | ||
|
||
const height2 = 20 | ||
|
||
const height3 = 20 | ||
|
||
const space = | ||
padding + height1 + (padding / 2 + height2) + height3 + padding * 4 | ||
|
||
const y1 = padding + heading.height + padding * 2 + space * (i - 1) | ||
|
||
const y2 = y1 + padding + height1 | ||
|
||
const y3 = y2 + padding / 2 + height2 | ||
|
||
list.push( | ||
<Fragment key={`${i}-${j}`}> | ||
<rect | ||
x={x} | ||
y={y1} | ||
rx={borderRadius} | ||
ry={borderRadius} | ||
width={itemWidth} | ||
height={height1} | ||
/> | ||
<rect x={x} y={y2} rx={0} ry={0} width={itemWidth} height={height2} /> | ||
<rect | ||
x={x} | ||
y={y3} | ||
rx={0} | ||
ry={0} | ||
width={itemWidth * 0.6} | ||
height={height3} | ||
/> | ||
</Fragment> | ||
) | ||
|
||
if (i === row) { | ||
height = y3 + height3 | ||
} | ||
} | ||
} | ||
|
||
return ( | ||
<ContentLoader | ||
viewBox={`0 0 ${width} ${height}`} | ||
width={width} | ||
height={height} | ||
{...props} | ||
uniqueKey="product-list-card-skeleton" | ||
> | ||
{list} | ||
</ContentLoader> | ||
) | ||
} | ||
|
||
export default SkeletonProductCard |
File renamed without changes.
File renamed without changes.