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

Commit 7908085

Browse files
author
dengjun
committed
add loading component
1 parent c89e995 commit 7908085

File tree

4 files changed

+58
-3
lines changed

4 files changed

+58
-3
lines changed

src/components/Loading/index.jsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React, { useState } from "react";
2+
import PT from "prop-types";
3+
4+
import "./styles.scss";
5+
6+
const Loading = () => {
7+
const header =
8+
"Welcome to our BETA work listings site - Tell us what you think!";
9+
10+
return (
11+
<div styleName="loading-wrapper">
12+
<div styleName="loading-inner">
13+
<div>Loading spinner</div>
14+
<h4>LOADING</h4>
15+
<span>We are processing your gigs data</span>
16+
</div>
17+
</div>
18+
);
19+
};
20+
21+
Loading.propTypes = {};
22+
23+
export default Loading;

src/components/Loading/styles.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@import "styles/variables";
2+
@import "styles/mixins";
3+
4+
.loading-wrapper {
5+
width: 100%;
6+
border-radius: $border-radius-lg;
7+
background-color: rgba(42,42,42, 0.07);
8+
padding: 232px 0px;
9+
.loading-inner {
10+
display: flex;
11+
flex-direction: column;
12+
justify-content: center;
13+
align-items: center;
14+
& > h4 {
15+
margin-top: 10px;
16+
font-size: 34px;
17+
color: $tc-turquoise-dark1;
18+
line-height: 38px;
19+
letter-spacing: 0;
20+
text-align: center;
21+
}
22+
& > span {
23+
font-size: 16px;
24+
color: $tc-gray1;
25+
text-align: center;
26+
line-height: 26px;
27+
margin-top: 10px;
28+
}
29+
}
30+
}

src/containers/MyGigs/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import PT from "prop-types";
44
import { connect } from "react-redux";
55
import Modal from "../../components/Modal";
66
import Button from "../../components/Button";
7+
import Loading from "../../components/Loading";
78
import JobListing from "./JobListing";
89
import actions from "../../actions";
910
import { EMPTY_GIGS_TEXT } from "../../constants";
@@ -87,17 +88,18 @@ const MyGigs = ({
8788
UPDATE GIG WORK PROFILE
8889
</Button>
8990
</h1>
90-
{myGigs && myGigs.length == 0 && (
91+
{!checkingGigs && myGigs && myGigs.length == 0 && (
9192
<h3 styleName="empty-label">{EMPTY_GIGS_TEXT}</h3>
9293
)}
93-
{myGigs && myGigs.length > 0 && (
94+
{!checkingGigs && myGigs && myGigs.length > 0 && (
9495
<JobListing
9596
jobs={myGigs}
9697
loadMore={loadMore}
9798
total={total}
9899
numLoaded={numLoaded}
99100
/>
100101
)}
102+
{checkingGigs && <Loading />}
101103
</div>
102104
<Modal open={openUpdateProfile}>
103105
<UpdateGigProfile

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: false,
18+
checkingGigs: true,
1919
};
2020

2121
function onGetMyGigsInit(state) {

0 commit comments

Comments
 (0)