|
1
|
|
|
import React from "react"; |
|
2
|
|
|
import { |
|
3
|
|
|
WrappedComponentProps, |
|
4
|
|
|
FormattedMessage, |
|
5
|
|
|
defineMessages, |
|
6
|
|
|
injectIntl, |
|
7
|
|
|
} from "react-intl"; |
|
8
|
|
|
import { Job } from "../../models/types"; |
|
9
|
|
|
import { |
|
10
|
|
|
frequencyName, |
|
11
|
|
|
travelRequirementDescription, |
|
12
|
|
|
overtimeRequirementDescription, |
|
13
|
|
|
} from "../../models/localizedConstants"; |
|
14
|
|
|
|
|
15
|
|
|
interface JobWorkCultureProps { |
|
16
|
|
|
job: Job; |
|
17
|
|
|
} |
|
18
|
|
|
|
|
19
|
|
|
const remoteWorkMessages = defineMessages({ |
|
20
|
|
|
always: { |
|
21
|
|
|
id: "jobBuilder.workCulture.remoteWorkMsg.always", |
|
22
|
|
|
defaultMessage: "Always", |
|
23
|
|
|
description: |
|
24
|
|
|
"Shown on Work Culture card when remoteWork field is set to true.", |
|
25
|
|
|
}, |
|
26
|
|
|
never: { |
|
27
|
|
|
id: "jobBuilder.workCulture.remoteWorkMsg.never", |
|
28
|
|
|
defaultMessage: "Never", |
|
29
|
|
|
description: |
|
30
|
|
|
"Shown on Work Culture card when remoteWork field is set to false.", |
|
31
|
|
|
}, |
|
32
|
|
|
}); |
|
33
|
|
|
|
|
34
|
|
|
export const JobWorkCulture: React.FunctionComponent< |
|
35
|
|
|
JobWorkCultureProps & WrappedComponentProps |
|
36
|
|
|
> = ({ job, intl }): React.ReactElement => { |
|
37
|
|
|
const { locale } = intl; |
|
38
|
|
|
if (locale !== "en" && locale !== "fr") { |
|
39
|
|
|
throw new Error("Unknown intl.locale"); |
|
40
|
|
|
} |
|
41
|
|
|
const remoteWork = intl.formatMessage( |
|
42
|
|
|
job.remote_work_allowed |
|
43
|
|
|
? remoteWorkMessages.always |
|
44
|
|
|
: remoteWorkMessages.never, |
|
45
|
|
|
); |
|
46
|
|
|
const telework = job.telework_allowed_frequency_id |
|
47
|
|
|
? intl.formatMessage(frequencyName(job.telework_allowed_frequency_id)) |
|
48
|
|
|
: ""; |
|
49
|
|
|
const flexHours = job.flexible_hours_frequency_id |
|
50
|
|
|
? intl.formatMessage(frequencyName(job.flexible_hours_frequency_id)) |
|
51
|
|
|
: ""; |
|
52
|
|
|
const travel = job.travel_requirement_id |
|
53
|
|
|
? intl.formatMessage( |
|
54
|
|
|
travelRequirementDescription(job.travel_requirement_id), |
|
55
|
|
|
) |
|
56
|
|
|
: ""; |
|
57
|
|
|
const overtime = job.overtime_requirement_id |
|
58
|
|
|
? intl.formatMessage( |
|
59
|
|
|
overtimeRequirementDescription(job.overtime_requirement_id), |
|
60
|
|
|
) |
|
61
|
|
|
: ""; |
|
62
|
|
|
return ( |
|
63
|
|
|
<div data-c-grid="gutter"> |
|
64
|
|
|
<div data-c-grid-item="tp(1of2) ds(1of3)"> |
|
65
|
|
|
<p data-c-colour="c2" data-c-margin="top(quarter)"> |
|
66
|
|
|
<FormattedMessage |
|
67
|
|
|
id="jobBuilder.workCulture.remoteWork" |
|
68
|
|
|
defaultMessage="Remote Work" |
|
69
|
|
|
description="Label for the Remote Work field on the Work Culture card." |
|
70
|
|
|
/> |
|
71
|
|
|
</p> |
|
72
|
|
|
<p |
|
73
|
|
|
data-c-font-size="small" |
|
74
|
|
|
data-c-colour="grey" |
|
75
|
|
|
data-c-margin="bottom(half)" |
|
76
|
|
|
> |
|
77
|
|
|
<FormattedMessage |
|
78
|
|
|
id="jobBuilder.workCulture.remoteWorkDescription" |
|
79
|
|
|
defaultMessage="Work from anywhere, all the time." |
|
80
|
|
|
description="Explanation of what Remote Work means." |
|
81
|
|
|
/> |
|
82
|
|
|
</p> |
|
83
|
|
|
<p>{remoteWork}</p> |
|
84
|
|
|
</div> |
|
85
|
|
|
<div data-c-grid-item="tp(1of2) ds(1of3)"> |
|
86
|
|
|
<p data-c-colour="c2" data-c-margin="top(quarter)"> |
|
87
|
|
|
<FormattedMessage |
|
88
|
|
|
id="jobBuilder.workCulture.telework" |
|
89
|
|
|
defaultMessage="Telework" |
|
90
|
|
|
description="Label for the Telework field on the Work Culture card." |
|
91
|
|
|
/> |
|
92
|
|
|
</p> |
|
93
|
|
|
<p |
|
94
|
|
|
data-c-font-size="small" |
|
95
|
|
|
data-c-colour="grey" |
|
96
|
|
|
data-c-margin="bottom(half)" |
|
97
|
|
|
> |
|
98
|
|
|
<FormattedMessage |
|
99
|
|
|
id="jobBuilder.workCulture.teleworkDescription" |
|
100
|
|
|
defaultMessage="Work from home somedays (within driving distance of the office)." |
|
101
|
|
|
description="Explanation of what Telework means." |
|
102
|
|
|
/> |
|
103
|
|
|
</p> |
|
104
|
|
|
<p>{telework}</p> |
|
105
|
|
|
</div> |
|
106
|
|
|
<div data-c-grid-item="tp(1of2) ds(1of3)"> |
|
107
|
|
|
<p data-c-colour="c2" data-c-margin="top(quarter)"> |
|
108
|
|
|
<FormattedMessage |
|
109
|
|
|
id="jobBuilder.workCulture.flexibleHours" |
|
110
|
|
|
defaultMessage="Flexible Hours" |
|
111
|
|
|
description="Label for the Flexible Hours field on the Work Culture card." |
|
112
|
|
|
/> |
|
113
|
|
|
</p> |
|
114
|
|
|
<p |
|
115
|
|
|
data-c-font-size="small" |
|
116
|
|
|
data-c-colour="grey" |
|
117
|
|
|
data-c-margin="bottom(half)" |
|
118
|
|
|
> |
|
119
|
|
|
<FormattedMessage |
|
120
|
|
|
id="jobBuilder.workCulture.flexibleHoursDescription" |
|
121
|
|
|
defaultMessage="Set your own start and end times." |
|
122
|
|
|
description="Explanation of what Flexible Hours means." |
|
123
|
|
|
/> |
|
124
|
|
|
</p> |
|
125
|
|
|
<p>{flexHours}</p> |
|
126
|
|
|
</div> |
|
127
|
|
|
<div data-c-grid-item="tp(1of2) ds(1of3)"> |
|
128
|
|
|
<p data-c-colour="c2" data-c-margin="top(quarter)"> |
|
129
|
|
|
<FormattedMessage |
|
130
|
|
|
id="jobBuilder.workCulture.travel" |
|
131
|
|
|
defaultMessage="Travel" |
|
132
|
|
|
description="Label for the Travel field on the Work Culture card." |
|
133
|
|
|
/> |
|
134
|
|
|
</p> |
|
135
|
|
|
<p |
|
136
|
|
|
data-c-font-size="small" |
|
137
|
|
|
data-c-colour="grey" |
|
138
|
|
|
data-c-margin="bottom(half)" |
|
139
|
|
|
> |
|
140
|
|
|
<FormattedMessage |
|
141
|
|
|
id="jobBuilder.workCulture.travelDescription" |
|
142
|
|
|
defaultMessage="See more of Canada or the world." |
|
143
|
|
|
description="Explanation of what Travel means." |
|
144
|
|
|
/> |
|
145
|
|
|
</p> |
|
146
|
|
|
<p>{travel}</p> |
|
147
|
|
|
</div> |
|
148
|
|
|
<div data-c-grid-item="tp(1of2) ds(1of3)"> |
|
149
|
|
|
<p data-c-colour="c2" data-c-margin="top(quarter)"> |
|
150
|
|
|
<FormattedMessage |
|
151
|
|
|
id="jobBuilder.workCulture.overtime" |
|
152
|
|
|
defaultMessage="Overtime" |
|
153
|
|
|
description="Label for the Overtime field on the Work Culture card." |
|
154
|
|
|
/> |
|
155
|
|
|
</p> |
|
156
|
|
|
<p |
|
157
|
|
|
data-c-font-size="small" |
|
158
|
|
|
data-c-colour="grey" |
|
159
|
|
|
data-c-margin="bottom(half)" |
|
160
|
|
|
> |
|
161
|
|
|
<FormattedMessage |
|
162
|
|
|
id="jobBuilder.workCulture.overtimeDescription" |
|
163
|
|
|
defaultMessage="Work extra hours in the evenings/on weekends." |
|
164
|
|
|
description="Explanation of what Overtime means." |
|
165
|
|
|
/> |
|
166
|
|
|
</p> |
|
167
|
|
|
<p>{overtime}</p> |
|
168
|
|
|
</div> |
|
169
|
|
|
</div> |
|
170
|
|
|
); |
|
171
|
|
|
}; |
|
172
|
|
|
|
|
173
|
|
|
export default injectIntl(JobWorkCulture); |
|
174
|
|
|
|