Skip to content

Commit 84b83a0

Browse files
Merge pull request #7085 from hotosm/fix/6941-update-badges-levels-loader
Fix/6941 update badges levels loader
2 parents aa35d50 + b33fc20 commit 84b83a0

File tree

4 files changed

+57
-2
lines changed

4 files changed

+57
-2
lines changed

frontend/src/components/badges/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useDropzone } from 'react-dropzone';
1010
import messages from './messages';
1111
import { Button } from '../button';
1212
import { Management } from '../teamsAndOrgs/management';
13-
import { nCardPlaceholders } from '../licenses/licensesPlaceholder';
13+
import { nCardPlaceholders } from './nCardPlaceholders';
1414
import { CircleMinusIcon } from '../svgIcons';
1515
import { OHSOME_STATS_TOPICS, IMAGE_UPLOAD_SERVICE } from '../../config';
1616
import { SwitchToggle } from '../formInputs';
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { TextRow, RectShape } from 'react-placeholder/lib/placeholders';
2+
3+
export const BudgetCardPlaceholderTemplate = () => (_n, i) =>
4+
(
5+
<div className="w-25-ns w-100 fl pr3 pb4" key={i}>
6+
<div className="cf bg-white blue-dark b--grey-light shadow-hover flex ph2 pv2">
7+
<RectShape
8+
className="show-loading-animation"
9+
color="#CCC"
10+
style={{ height: '60px', width: '60px' }}
11+
/>
12+
<div className="flex flex-column w-100">
13+
<TextRow
14+
className="show-loading-animation"
15+
color="#CCC"
16+
style={{ height: '30px', width: '50%', marginTop: '0px' }}
17+
/>
18+
<TextRow
19+
className="show-loading-animation"
20+
color="#CCC"
21+
style={{ height: '15px', width: '80%' }}
22+
/>
23+
</div>
24+
</div>
25+
</div>
26+
);
27+
28+
export const nCardPlaceholders = (N) => {
29+
return [...Array(N).keys()].map(BudgetCardPlaceholderTemplate());
30+
};

frontend/src/components/levels/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useState } from 'react';
88
import messages from './messages';
99
import { Button } from '../button';
1010
import { Management } from '../teamsAndOrgs/management';
11-
import { nCardPlaceholders } from '../licenses/licensesPlaceholder';
11+
import { nCardPlaceholders } from './nCardPlaceholder';
1212
import { SwitchToggle } from '../formInputs';
1313
import { CircleMinusIcon } from '../svgIcons';
1414

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { TextRow, RectShape } from 'react-placeholder/lib/placeholders';
2+
3+
export const LevelCardPlaceholderTemplate = () => (_n, i) =>
4+
(
5+
<div className="w-100-ns w-100 fl pr3 pb3" key={i}>
6+
<div className="cf bg-white blue-dark b--grey-light shadow-hover flex ph2 pv2">
7+
<RectShape
8+
className="show-loading-animation"
9+
color="#CCC"
10+
style={{ height: '35px', width: '20px' }}
11+
/>
12+
<div className="flex flex-column w-100 justify-center">
13+
<TextRow
14+
className="show-loading-animation"
15+
color="#CCC"
16+
style={{ height: '35px', width: '100%', marginTop: '0px' }}
17+
/>
18+
</div>
19+
</div>
20+
</div>
21+
);
22+
23+
export const nCardPlaceholders = (N) => {
24+
return [...Array(N).keys()].map(LevelCardPlaceholderTemplate());
25+
};

0 commit comments

Comments
 (0)