File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change
1
+ const { createElement } = react ;
2
+
3
+ export const LoadingSpinner = ( ) => {
4
+ return createElement ( 'aside' , { class : 'users_section' } , [
5
+ createElement ( 'div' , { class : 'loading' } , [ 'Loading...' ] ) ,
6
+ ] ) ;
7
+ } ;
Original file line number Diff line number Diff line change 1
1
const { createElement } = react ;
2
+ import { LoadingSpinner } from './LoadingSpinner.js' ;
2
3
3
4
export const UsersSection = ( {
4
5
users,
@@ -20,9 +21,7 @@ export const UsersSection = ({
20
21
) ;
21
22
22
23
if ( isLoading ) {
23
- return createElement ( 'aside' , { class : 'users_section' } , [
24
- createElement ( 'div' , { class : 'loading' } , [ 'Loading...' ] ) ,
25
- ] ) ;
24
+ return LoadingSpinner ( ) ;
26
25
}
27
26
28
27
return createElement (
@@ -45,13 +44,6 @@ export const UsersSection = ({
45
44
src : user ?. picture ?. url ?? dummyPicture ,
46
45
class : 'user_image' ,
47
46
} ) ,
48
- /* will uncomment this once we have actual paginated data from the API */
49
-
50
- // createElement('span', {}, [
51
- // user.first_name + ' ' + user.last_name + user.username,
52
- // ]),
53
-
54
- /* will remove this once we have actual paginated data from the API */
55
47
createElement ( 'span' , { } , [ user . username ] ) ,
56
48
] ,
57
49
) ;
You can’t perform that action at this time.
0 commit comments