@@ -19,6 +19,8 @@ import { getQuery, updateQuery } from 'utils/url';
19
19
import { withOptimizely } from '@optimizely/react-sdk' ;
20
20
import './jobLisingStyles.scss' ;
21
21
22
+ const cookies = require ( 'browser-cookies' ) ;
23
+
22
24
const CONTENT_PREVIEW_LENGTH = 175 ;
23
25
const GIGS_PER_PAGE = 10 ;
24
26
// Sort by dropdown
@@ -47,7 +49,7 @@ class RecruitCRMJobsContainer extends React.Component {
47
49
this . onFilter = this . onFilter . bind ( this ) ;
48
50
this . onLocation = this . onLocation . bind ( this ) ;
49
51
this . onSort = this . onSort . bind ( this ) ;
50
- this . onHotlistApply = this . onHotlistApply . bind ( this ) ;
52
+ this . onHotlistClick = this . onHotlistClick . bind ( this ) ;
51
53
}
52
54
53
55
componentDidMount ( ) {
@@ -121,9 +123,14 @@ class RecruitCRMJobsContainer extends React.Component {
121
123
} ) ;
122
124
}
123
125
124
- onHotlistApply ( ) {
126
+ onHotlistClick ( job ) {
125
127
const { optimizely } = this . props ;
126
128
optimizely . track ( 'Hotlist ads click' ) ;
129
+ cookies . set ( '_tc.hcl' , JSON . stringify ( {
130
+ slug : job . slug ,
131
+ } ) , {
132
+ expires : 0 ,
133
+ } ) ;
127
134
}
128
135
129
136
render ( ) {
@@ -151,7 +158,8 @@ class RecruitCRMJobsContainer extends React.Component {
151
158
// optimizely decide
152
159
let decision = { enabled : true } ;
153
160
if ( isomorphy . isClientSide ( ) ) {
154
- decision = optimizely . decide ( 'gig_listing_hotlist' ) ;
161
+ // decision = optimizely.decide('gig_listing_hotlist');
162
+ decision = optimizely . decide ( 'gig_listing_hotlist_center' ) ;
155
163
}
156
164
let jobsToDisplay = jobs ;
157
165
// build hotlist of jobs if present
@@ -244,7 +252,7 @@ class RecruitCRMJobsContainer extends React.Component {
244
252
< div styleName = "hotlist-items" >
245
253
{
246
254
hotlistJobs . map ( ( hjob , indx ) => ( indx <= 1 ? (
247
- < Link styleName = { `hotlist-item-${ indx + 1 } ` } to = { `${ config . GIGS_PAGES_PATH } /${ hjob . slug } ` } key = { `hotlist-item-${ indx + 1 } ` } onClick = { this . onHotlistApply } >
255
+ < Link styleName = { `hotlist-item-${ indx + 1 } ` } to = { `${ config . GIGS_PAGES_PATH } /${ hjob . slug } ` } key = { `hotlist-item-${ indx + 1 } ` } onClick = { ( ) => this . onHotlistClick ( hjob ) } >
248
256
< div styleName = "location" > < IconBlackLocation /> { hjob . country } </ div >
249
257
< h5 styleName = "job-title" > { hjob . name } </ h5 >
250
258
< div styleName = "job-money" > ${ hjob . min_annual_salary } - { hjob . max_annual_salary } / { getSalaryType ( hjob . salary_type ) } </ div >
@@ -272,7 +280,7 @@ class RecruitCRMJobsContainer extends React.Component {
272
280
</ div >
273
281
) : null
274
282
}
275
- < Link styleName = { `hotlist-item-button-${ indx + 1 } ` } to = { `${ config . GIGS_PAGES_PATH } /${ hjob . slug } ` } onClick = { this . onHotlistApply } > Apply Now</ Link >
283
+ < Link styleName = { `hotlist-item-button-${ indx + 1 } ` } to = { `${ config . GIGS_PAGES_PATH } /${ hjob . slug } ` } onClick = { ( ) => this . onHotlistClick ( hjob ) } > Apply Now</ Link >
276
284
</ div >
277
285
) ) )
278
286
}
0 commit comments