Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit dcd327f

Browse files
author
dengjun
committed
ci:add loading screen
1 parent 7908085 commit dcd327f

File tree

6 files changed

+47
-9
lines changed

6 files changed

+47
-9
lines changed

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"react-date-range": "^1.1.3",
8282
"react-dom": "^16.12.0",
8383
"react-dropzone": "^11.3.2",
84+
"react-loading": "^2.0.3",
8485
"react-redux": "^7.2.3",
8586
"react-responsive-modal": "^6.1.0",
8687
"react-select": "^1.3.0",

src/components/Loading/index.jsx

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,40 @@
1-
import React, { useState } from "react";
1+
import React from "react";
2+
import ReactLoading from "react-loading";
23
import PT from "prop-types";
3-
44
import "./styles.scss";
55

6-
const Loading = () => {
7-
const header =
8-
"Welcome to our BETA work listings site - Tell us what you think!";
9-
6+
const Loading = (props) => {
7+
const { color, type, height, width } = props;
108
return (
119
<div styleName="loading-wrapper">
1210
<div styleName="loading-inner">
13-
<div>Loading spinner</div>
11+
<div>
12+
<ReactLoading
13+
type={type}
14+
color={color}
15+
height={height}
16+
width={width}
17+
/>
18+
</div>
1419
<h4>LOADING</h4>
1520
<span>We are processing your gigs data</span>
1621
</div>
1722
</div>
1823
);
1924
};
2025

21-
Loading.propTypes = {};
26+
Loading.defaultProps = {
27+
color: "#0ab88a",
28+
type: "spin",
29+
width: 35,
30+
height: 35,
31+
};
32+
33+
Loading.propTypes = {
34+
color: PT.string,
35+
type: PT.string,
36+
width: PT.number,
37+
height: PT.number,
38+
};
2239

2340
export default Loading;

src/components/Loading/styles.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import "styles/variables";
22
@import "styles/mixins";
3+
@import "styles/animations";
34

45
.loading-wrapper {
56
width: 100%;
@@ -26,5 +27,15 @@
2627
line-height: 26px;
2728
margin-top: 10px;
2829
}
30+
svg {
31+
path:first-child {
32+
fill: $tc-gray4;
33+
opacity: 1;
34+
}
35+
path:last-child {
36+
animation: rotate 0.8s linear infinite;
37+
transform-origin: 50% 50%;
38+
}
39+
}
2940
}
3041
}

src/reducers/myGigs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const defaultState = {
1515
updatingProfile: false,
1616
updatingProfileError: null,
1717
updatingProfileSucess: null,
18-
checkingGigs: true,
18+
checkingGigs: false,
1919
};
2020

2121
function onGetMyGigsInit(state) {

src/styles/animations.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@keyframes rotate {
2+
from { transform: rotate(0deg);}
3+
to { transform: rotate(360deg); }
4+
}

0 commit comments

Comments
 (0)