Skip to content

Commit 45a4d8f

Browse files
committed
Location dropdown final fixes
1 parent a7a0567 commit 45a4d8f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/shared/components/Contentful/AppComponent/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function AppComponentSwitch(appComponent) {
3232
);
3333
}
3434
if (appComponent.fields.type === 'RecruitCRM-Jobs') {
35-
return <RecruitCRMJobs {...appComponent.fields.props} />;
35+
return <RecruitCRMJobs {...appComponent.fields.props} key={appComponent.sys.id} />;
3636
}
3737
fireErrorMessage('Unsupported app component type from contentful', '');
3838
return null;

src/shared/containers/Gigs/RecruitCRMJobs.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ const sortByOptions = [
2121
{ label: 'Latest Updated Descending', selected: false },
2222
];
2323
// Locations
24-
const locations = [{
25-
label: 'Anywhere', selected: true,
26-
}];
24+
let locations = [];
2725

2826
class RecruitCRMJobsContainer extends React.Component {
2927
constructor(props) {
@@ -33,7 +31,7 @@ class RecruitCRMJobsContainer extends React.Component {
3331
term: '',
3432
page: 0,
3533
sortBy: 'created_on',
36-
location: 'Anywhere',
34+
location: 'Any Location',
3735
};
3836
// binds
3937
this.onSearch = this.onSearch.bind(this);
@@ -127,6 +125,8 @@ class RecruitCRMJobsContainer extends React.Component {
127125
if (location === 'Anywhere' || location === 'Any' || location === 'Any Location') return true;
128126
return location.toLowerCase() === job.country.toLowerCase();
129127
});
128+
// sort location dropdown
129+
locations = _.sortBy(locations, ['label']);
130130
// Filter by term
131131
if (term) {
132132
jobsToDisplay = _.filter(jobsToDisplay, (job) => {
@@ -178,11 +178,12 @@ class RecruitCRMJobsContainer extends React.Component {
178178

179179
RecruitCRMJobsContainer.defaultProps = {
180180
jobs: [],
181+
loading: true,
181182
};
182183

183184
RecruitCRMJobsContainer.propTypes = {
184185
getJobs: PT.func.isRequired,
185-
loading: PT.bool.isRequired,
186+
loading: PT.bool,
186187
jobs: PT.arrayOf(PT.shape),
187188
};
188189

0 commit comments

Comments
 (0)