This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +40
-16
lines changed Expand file tree Collapse file tree 3 files changed +40
-16
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
- import { EMPTY_GIGS_TEXT } from "../../constants" ;
2
+ import PT from "prop-types" ;
3
+ import {
4
+ MY_GIGS_STATUS_EMPTY_TEXT ,
5
+ GIGS_FILTER_STATUSES ,
6
+ } from "../../constants" ;
3
7
import Button from "../Button" ;
4
8
import "./styles.scss" ;
5
9
6
- const Empty = ( ) => {
10
+ const Empty = ( { gigStatus } ) => {
7
11
return (
8
12
< div styleName = "empty-wrapper" >
9
13
< div styleName = "empty-inner" >
10
- < h6 > { EMPTY_GIGS_TEXT } </ h6 >
11
- < span > Interested in getting a gig?</ span >
12
- < Button
13
- isPrimary
14
- size = "lg"
15
- onClick = { ( ) => {
16
- window . location . href = `${ process . env . URL . BASE } /gigs` ;
17
- } }
18
- >
19
- VIEW GIGS
20
- </ Button >
14
+ < h6 > { MY_GIGS_STATUS_EMPTY_TEXT [ gigStatus ] } </ h6 >
15
+ { gigStatus == GIGS_FILTER_STATUSES . OPEN_JOBS && (
16
+ < span > Interested in getting a gig?</ span >
17
+ ) }
18
+ { gigStatus == GIGS_FILTER_STATUSES . OPEN_JOBS && (
19
+ < Button
20
+ isPrimary
21
+ size = "lg"
22
+ onClick = { ( ) => {
23
+ window . location . href = `${ process . env . URL . BASE } /gigs` ;
24
+ } }
25
+ >
26
+ VIEW GIGS
27
+ </ Button >
28
+ ) }
21
29
</ div >
22
30
</ div >
23
31
) ;
24
32
} ;
25
33
34
+ Empty . defaultProps = {
35
+ gigStatus : GIGS_FILTER_STATUSES . OPEN_JOBS ,
36
+ } ;
37
+
38
+ Empty . propTypes = {
39
+ gigStatus : PT . string ,
40
+ } ;
41
+
26
42
export default Empty ;
Original file line number Diff line number Diff line change @@ -386,8 +386,14 @@ export const GIG_STATUS_TOOLTIP = {
386
386
UNAVAILABLE : "You’re not open to take on new jobs." ,
387
387
} ;
388
388
389
- export const EMPTY_GIGS_TEXT =
390
- "LOOKS LIKE YOU HAVEN'T APPLIED TO ANY GIG OPPORTUNITIES YET." ;
389
+ export const MY_GIGS_STATUS_EMPTY_TEXT = {
390
+ [ GIGS_FILTER_STATUSES . ACTIVE_JOBS ] : "YOU DON'T HAVE ANY ACTIVE GIGS YET." ,
391
+ [ GIGS_FILTER_STATUSES . OPEN_JOBS ] :
392
+ "LOOKS LIKE YOU HAVEN'T APPLIED TO ANY GIG OPPORTUNITIES YET." ,
393
+ [ GIGS_FILTER_STATUSES . COMPLETED_JOBS ] :
394
+ "YOU DON'T HAVE ANY COMPLETED GIGS YET." ,
395
+ [ GIGS_FILTER_STATUSES . ARCHIVED_JOBS ] : "YOU DON'T HAVE ANY ARCHIVED GIGS YET." ,
396
+ } ;
391
397
392
398
export const CHECKING_GIG_TIMES = 3 ;
393
399
Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ const MyGigs = ({
99
99
</ Button >
100
100
</ div >
101
101
</ h1 >
102
- { ! checkingGigs && myGigs && myGigs . length == 0 && < Empty /> }
102
+ { ! checkingGigs && myGigs && myGigs . length == 0 && (
103
+ < Empty gigStatus = { gigStatus } />
104
+ ) }
103
105
{ ! checkingGigs && myGigs && myGigs . length > 0 && (
104
106
< JobListing
105
107
gigStatus = { gigStatus }
You can’t perform that action at this time.
0 commit comments