Skip to content

Commit a83653b

Browse files
author
Programming-Sai
committed
Editted the page loader component
1 parent c51d681 commit a83653b

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed
+23-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
1-
import React from 'react'
2-
import styles from './pageloader.module.css'
1+
import React from "react";
2+
import styles from "./pageloader.module.css";
3+
import BASE_PATH from "../../../base";
34

45
const PageLoader = ({ widthOfSlice, slices, img, isBorderRadius }) => {
5-
if (!slices){
6+
if (!slices) {
67
slices = 10;
78
}
89

9-
if (!widthOfSlice){
10+
if (!widthOfSlice) {
1011
widthOfSlice = 60;
1112
}
1213

13-
if (!img){
14-
img = '/favicon.ico';
14+
if (!img) {
15+
img = "/favicon.ico";
1516
}
16-
17+
1718
return (
1819
<div className={styles.container}>
1920
<div className={styles.box}>
2021
<div>
21-
{Array.from( {length: slices }, (_, i)=>(
22-
<span key={i} style={{'--i': i, '--slices': slices, '--img': `url(${img})`, '--width': `${widthOfSlice}px`, borderRadius: isBorderRadius ? '20px' : '0'}}></span>
23-
))}
22+
{Array.from({ length: slices }, (_, i) => (
23+
<span
24+
key={i}
25+
style={{
26+
"--i": i,
27+
"--slices": slices,
28+
"--img": `url(${BASE_PATH}${img})`,
29+
"--width": `${widthOfSlice}px`,
30+
borderRadius: isBorderRadius ? "20px" : "0",
31+
}}
32+
></span>
33+
))}
2434
</div>
2535
</div>
2636
</div>
27-
)
28-
}
37+
);
38+
};
2939

30-
export default PageLoader
40+
export default PageLoader;

0 commit comments

Comments
 (0)