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 11import 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" ;
37import Button from "../Button" ;
48import "./styles.scss" ;
59
6- const Empty = ( ) => {
10+ const Empty = ( { gigStatus } ) => {
711 return (
812 < div styleName = "empty-wrapper" >
913 < 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+ ) }
2129 </ div >
2230 </ div >
2331 ) ;
2432} ;
2533
34+ Empty . defaultProps = {
35+ gigStatus : GIGS_FILTER_STATUSES . OPEN_JOBS ,
36+ } ;
37+
38+ Empty . propTypes = {
39+ gigStatus : PT . string ,
40+ } ;
41+
2642export default Empty ;
Original file line number Diff line number Diff line change @@ -386,8 +386,14 @@ export const GIG_STATUS_TOOLTIP = {
386386 UNAVAILABLE : "You’re not open to take on new jobs." ,
387387} ;
388388
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+ } ;
391397
392398export const CHECKING_GIG_TIMES = 3 ;
393399
Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ const MyGigs = ({
9999 </ Button >
100100 </ div >
101101 </ h1 >
102- { ! checkingGigs && myGigs && myGigs . length == 0 && < Empty /> }
102+ { ! checkingGigs && myGigs && myGigs . length == 0 && (
103+ < Empty gigStatus = { gigStatus } />
104+ ) }
103105 { ! checkingGigs && myGigs && myGigs . length > 0 && (
104106 < JobListing
105107 gigStatus = { gigStatus }
You can’t perform that action at this time.
0 commit comments