File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ function ScaleLoader({
1919 width = 4 ,
2020 radius = 2 ,
2121 margin = 2 ,
22+ barCount = 5 ,
2223 ...additionalprops
23- } : LoaderHeightWidthRadiusProps ) : JSX . Element | null {
24+ } : LoaderHeightWidthRadiusProps & { barCount : number } ) : JSX . Element | null {
2425 const wrapper : React . CSSProperties = {
2526 display : "inherit" ,
2627 ...cssOverride ,
@@ -45,11 +46,9 @@ function ScaleLoader({
4546
4647 return (
4748 < span style = { wrapper } { ...additionalprops } >
48- < span style = { style ( 1 ) } />
49- < span style = { style ( 2 ) } />
50- < span style = { style ( 3 ) } />
51- < span style = { style ( 4 ) } />
52- < span style = { style ( 5 ) } />
49+ { [ ...Array ( barCount ) ] . map ( ( _ , i ) => (
50+ < span key = { i } style = { style ( i + 1 ) } />
51+ ) ) }
5352 </ span >
5453 ) ;
5554}
You can’t perform that action at this time.
0 commit comments