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

Commit 976ae81

Browse files
author
dengjun
committed
fix empty label
1 parent a1f5161 commit 976ae81

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

src/constants/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,6 @@ export const GIG_STATUS = {
345345
UNAVAILABLE: "Unavailable",
346346
PLACED: "Placed",
347347
};
348+
349+
export const EMPTY_GIGS_TEXT =
350+
"Looks like you haven't applied to any gig opportunities yet.";

src/containers/MyGigs/index.jsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Modal from "../../components/Modal";
55
import Button from "../../components/Button";
66
import JobListing from "./JobListing";
77
import actions from "../../actions";
8+
import { EMPTY_GIGS_TEXT } from "../../constants";
89

910
import UpdateGigProfile from "./modals/UpdateGigProfile";
1011
import UpdateSuccess from "./modals/UpdateSuccess";
@@ -50,20 +51,25 @@ const MyGigs = ({
5051
<Button
5152
isPrimary
5253
size="lg"
53-
disabled="true"
54+
disabled={true}
5455
onClick={() => {
5556
setOpenUpdateProfile(true);
5657
}}
5758
>
5859
UPDATE GIG WORK PROFILE
5960
</Button>
6061
</h1>
61-
<JobListing
62-
jobs={myGigs}
63-
loadMore={loadMore}
64-
total={total}
65-
numLoaded={numLoaded}
66-
/>
62+
{myGigs && myGigs.length == 0 && (
63+
<h3 styleName="empty-label">{EMPTY_GIGS_TEXT}</h3>
64+
)}
65+
{myGigs && myGigs.length > 0 && (
66+
<JobListing
67+
jobs={myGigs}
68+
loadMore={loadMore}
69+
total={total}
70+
numLoaded={numLoaded}
71+
/>
72+
)}
6773
</div>
6874
<Modal open={openUpdateProfile}>
6975
<UpdateGigProfile

src/containers/MyGigs/styles.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@
2020
margin-left: auto;
2121
}
2222
}
23+
24+
.empty-label {
25+
text-align: center;
26+
margin-top: 100px;
27+
}

src/reducers/lookup.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ function onCheckIsLoggedInDone(state, { payload }) {
2323
return { ...state, isLoggedIn: payload };
2424
}
2525

26-
2726
function onGetGigStatusesDone(state, { payload }) {
2827
return { ...state, gigStatuses: payload };
2928
}

src/reducers/myGigs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { handleActions } from "redux-actions";
44
const defaultState = {
55
loadingMyGigs: false,
66
loadingMyGigsError: null,
7-
myGigs: [],
7+
myGigs: null,
88
total: 0,
99
numLoaded: 0,
1010
loadingMore: false,
@@ -37,7 +37,7 @@ function onGetMyGigsFailure(state, { payload }) {
3737
...state,
3838
loadingMyGigs: false,
3939
loadingMyGigsError: payload,
40-
myGigs: [],
40+
myGigs: null,
4141
total: 0,
4242
numLoaded: 0,
4343
};

0 commit comments

Comments
 (0)