Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Display featured jobs on Jobs page, above search results #985

Merged
merged 9 commits into from
Jul 13, 2018
43 changes: 43 additions & 0 deletions src/scenes/home/jobs/featuredJob/featuredJob.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Note: these styles are copied to match the ziprecruiter styles that are being dynamically inserted on our page (see jobs.js) */

.job {
padding: 15px 0px;
}

.link {
text-decoration: none;
color: #1a0dab;
font-size: 17px;
float: left;
margin-right: 3px;
margin-bottom: 1px;
}

.details {
font-size: 13px;
color: #999999;
margin: 3px 0;
clear: both;
}

.detailsContainer {
float: left;
margin-right: 15px;
}

.detail {
margin-left: 4px;
}

.remote {
composes: detail;
font-style: italic;
}

.description {
clear: both;
font-size: 14px;
color: #545454;
line-height: 1.4;
word-wrap: break-word;
}
65 changes: 65 additions & 0 deletions src/scenes/home/jobs/featuredJob/featuredJob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React from 'react';
import PropTypes from 'prop-types';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import { faMapMarkerAlt, faBuilding, faCloudUploadAlt } from '@fortawesome/fontawesome-free-solid';
import OutboundLink from 'shared/components/outboundLink/outboundLink';
import styles from './featuredJob.css';

const FeaturedJob = ({
title,
source,
sourceUrl,
city,
state,
country,
description,
remote
}) => (
<div>
<div className={styles.job}>
<div>
<OutboundLink href={sourceUrl} analyticsEventLabel={`[FeaturedJob] ${sourceUrl}`}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌 ty for thinking of analytics

<span className={styles.link}>{title}</span>
</OutboundLink>
</div>
<div className={styles.details}>
<div className={styles.detailsContainer}>
<FontAwesomeIcon icon={faBuilding} size="sm" style={{ color: '#afafaf' }} />
<span className={styles.detail}>{source}</span>
</div>
<div className={styles.detailsContainer}>
<FontAwesomeIcon icon={faMapMarkerAlt} size="sm" style={{ color: '#afafaf' }} />
<span className={styles.detail}>{city},</span>
<span className={styles.detail}>{state},</span>
<span className={styles.detail}>{country}</span>
</div>
{remote &&
<div className={styles.detailsContainer}>
<FontAwesomeIcon icon={faCloudUploadAlt} size="sm" style={{ color: '#afafaf' }} />
<span className={styles.remote}>Remote</span>
</div>
}
</div>
<div className={styles.description}>
{description}
</div>
</div>
</div >
);

FeaturedJob.propTypes = {
title: PropTypes.string.isRequired,
source: PropTypes.string.isRequired,
sourceUrl: PropTypes.string.isRequired,
city: PropTypes.string.isRequired,
state: PropTypes.string.isRequired,
country: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
remote: PropTypes.bool
};

FeaturedJob.defaultProps = {
remote: false
};

export default FeaturedJob;
50 changes: 50 additions & 0 deletions src/scenes/home/jobs/featuredJobs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"title": "Software Engineer",
"source": "Microsoft",
"sourceUrl": "https://www.microsoft.com",
"city": "Redmond",
"state": "Washington",
"country": "United States",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"status": "active",
"remote": false,
"tags": [
"C#",
"ASP.Net",
"DevOps"
]
},
{
"title": "QA Engineer",
"source": "Apple",
"sourceUrl": "https://www.apple.com",
"city": "San Francisco",
"state": "California",
"country": "United States",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ",
"status": "active",
"remote": true,
"tags": [
"C#",
"ASP.Net",
"DevOps"
]
},
{
"title": "DevOps Engineeer",
"source": "GitHub",
"sourceUrl": "https://www.github.com",
"city": "Austin",
"state": "texas",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Texas

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This JSON file is just mock data for now. Its content will be replaced with actual featured jobs, or the JSON file will discarded completely once the API endpoint is ready.

"country": "United States",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
"status": "inactive",
"remote": false,
"tags": [
"C#",
"ASP.Net",
"DevOps"
]
}
]
14 changes: 14 additions & 0 deletions src/scenes/home/jobs/jobs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Note: these styles are copied to match the ziprecruiter styles that are inserted on our page */

.featuredJobsContainer {
width: 100%;
float: left;
clear: both;
}

.featuredJobs {
font-family: Arial, Helvetica, sans-serif;
margin: 30px 0px 10px;
width: 100%;
max-width: 768px;
}
37 changes: 34 additions & 3 deletions src/scenes/home/jobs/jobs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { Component } from 'react';
import Section from 'shared/components/section/section';
import FeaturedJob from './featuredJob/featuredJob';
import FeaturedJobsData from './featuredJobs.json';
import styles from './jobs.css';

const zipRecruiterScript = document.createElement('script');

Expand Down Expand Up @@ -29,11 +32,39 @@ class Jobs extends Component {
};
tryRunInit();
}

featuredJobs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to delete this line.

render() {
const featuredJobs = FeaturedJobsData
.filter(x => x.status === 'active')
.map(job => (
<FeaturedJob
key={`${Math.random()} + ${job.name} + ${job.sourceUrl}`}
title={job.title}
source={job.source}
sourceUrl={job.sourceUrl}
city={job.city}
state={job.state}
country={job.country}
description={job.description}
status={job.status}
remote={job.remote}
/>
));
return (
<Section title="Open Positions" theme="white">
<div id="zipsearch_container" />
</Section>
<div>
<Section title="Featured Jobs" theme="white">
<div className={styles.featuredJobsContainer}>
<div className={styles.featuredJobs}>
{featuredJobs}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should do

{FeaturedJobsData.length() > 0 ? featuredJobs : <div>some default content expressed a lack of featured jobs and how to get one featured</div>}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. We should probably have a contact link somewhere here. It should display whether or not there are any featured jobs exist. Can start off with an email link to @ksmacleod99 for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylemh As long as we have the contact link (explaining how to get a featured job), we can probably go live with this sooner (without any featured jobs yet). Test out the waters and see if we get anyone contacting us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. You've got the structure in place for jobs when they come in.

I'd say create the default, see what traffic - if any - we get towards that feature.

Back-end can look at the JSON in this PR as an example to prepare for, and the ticket can be ✅

Copy link
Member Author

@jjhampton jjhampton Jun 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylemh I also went ahead and set the three 'mock' Jobs in the JSON file as "status": "inactive", so they won't display on the page. I think back-end PR is actually nearing completion (to serve up API data), but I can leave the mock JSON data in there until then as a guide.

</div>
</div>
</Section>
<Section title="Search All Jobs" theme="white">
<div id="zipsearch_container" />
</Section>
</div>

);
}
}
Expand Down