forked from abalone0204/Clairvoyance
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request abalone0204#63 from abalone0204/goodjob
Goodjob
- Loading branch information
Showing
31 changed files
with
1,262 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { | ||
checkStatus, | ||
parseJSON, | ||
} from '../helper.js' | ||
|
||
export default function searchByJob({ | ||
company, | ||
}) { | ||
const options = { | ||
headers: { | ||
"Content-Type": "application/json" | ||
}, | ||
method: 'GET', | ||
mode: 'cors' | ||
} | ||
const url = `https://tranquil-fortress-92731.herokuapp.com/workings/statistics/by-company?company=${company}` | ||
return fetch(url, options) | ||
.then(checkStatus) | ||
.then(parseJSON) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import searchByJob from './searchByJob.js' | ||
|
||
const goodjob = { | ||
searchByJob, | ||
} | ||
export default goodjob | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { | ||
checkStatus, | ||
parseJSON, | ||
} from '../helper.js' | ||
|
||
|
||
export default function searchByJob({ | ||
job_title, | ||
page, | ||
}) { | ||
const options = { | ||
headers: { | ||
"Content-Type": "application/json" | ||
}, | ||
method: 'GET', | ||
mode: 'cors' | ||
} | ||
const baseURL = `https://tranquil-fortress-92731.herokuapp.com/clairvoyance/search/by-job?job_title=${job_title}` | ||
const url = page ? `${baseURL}&page=${page}` : `${baseURL}` | ||
return fetch(url, options) | ||
.then(checkStatus) | ||
.then(parseJSON) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
export function checkStatus(response) { | ||
if (response.status >= 200 && response.status < 300) { | ||
return response | ||
} else { | ||
var error = new Error(response.statusText) | ||
error.response = response | ||
throw error | ||
} | ||
if (response.status >= 200 && response.status < 300) { | ||
return response | ||
} else { | ||
var error = new Error(response.statusText) | ||
error.response = response | ||
throw error | ||
} | ||
} | ||
|
||
export function parseJSON(response) { | ||
return response.json() | ||
} | ||
return response.text() | ||
.then((text) => { | ||
return text ? JSON.parse(text) : {} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
export const REQUEST_FETCH_WORKING_TIME_BY_JOB_TITLE = 'REQUEST_FETCH_WORKING_TIME_BY_JOB_TITLE' | ||
export const RECEIVE_WORKING_TIME = 'RECEIVE_WORKING_TIME' | ||
export const FAIL_TO_FETCH_WORKING_TIME_BY_JOB_TITLE = 'FAIL_TO_FETCH_WORKING_TIME_BY_JOB_TITLE' | ||
|
||
export const REQUEST_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME = 'REQUEST_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME' | ||
export const RECEIVE_WORKING_TIME_STAT_BY_COMPANY_NAME = 'RECEIVE_WORKING_TIME_STAT_BY_COMPANY_NAME' | ||
export const FAIL_TO_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME = 'FAIL_TO_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME' | ||
|
||
|
||
export function requestFetchWorkingTimeByJobTitle({ | ||
job_title, | ||
page, | ||
}) { | ||
return { | ||
type: REQUEST_FETCH_WORKING_TIME_BY_JOB_TITLE, | ||
job_title, | ||
page, | ||
} | ||
} | ||
|
||
export function receiveWorkingTime(response) { | ||
return { | ||
type: RECEIVE_WORKING_TIME, | ||
response, | ||
} | ||
} | ||
|
||
export function failToFetchWorkingTimeByJobTitle(error) { | ||
return { | ||
type: FAIL_TO_FETCH_WORKING_TIME_BY_JOB_TITLE, | ||
error, | ||
} | ||
} | ||
|
||
export function requestFetchWorkingTimeStatByCompanyName({ | ||
company, | ||
page, | ||
}) { | ||
return { | ||
type: REQUEST_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME, | ||
company, | ||
page, | ||
} | ||
} | ||
|
||
export function receiveWorkingTimeStatByCompanyName(response) { | ||
return { | ||
type: RECEIVE_WORKING_TIME_STAT_BY_COMPANY_NAME, | ||
response, | ||
} | ||
} | ||
|
||
export function failToFetchWorkingTimeStatByCompanyName(error) { | ||
return { | ||
type: FAIL_TO_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME, | ||
error, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export const SET_INIT_JOB_OBJECT = 'SET_INIT_JOB_OBJECT' | ||
export const FETCH_INIT_JOB_OBJECT = 'FETCH_INIT_JOB_OBJECT' | ||
export const FAIL_TO_INIT_JOB_OBJECT = 'FAIL_TO_INIT_JOB_OBJECT' | ||
|
||
export function fetchInitJobObject() { | ||
return { | ||
type: FETCH_INIT_JOB_OBJECT, | ||
} | ||
} | ||
|
||
export function setInitJobObject({ | ||
job_name, | ||
company_name, | ||
}) { | ||
return { | ||
type: SET_INIT_JOB_OBJECT, | ||
job_name, | ||
company_name, | ||
} | ||
} | ||
|
||
export function failToInitJobObject(error) { | ||
return { | ||
type: FAIL_TO_INIT_JOB_OBJECT, | ||
error | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import CSSModules from 'react-css-modules' | ||
import styles from './styles.css' | ||
|
||
const Clock = () => ( | ||
<div styleName="clock"> | ||
<div styleName="top"></div> | ||
<div styleName="right"></div> | ||
<div styleName="bottom"></div> | ||
<div styleName="left"></div> | ||
<div styleName="center"></div> | ||
<div styleName="hour"></div> | ||
<div styleName="minute"></div> | ||
</div> | ||
) | ||
|
||
export default CSSModules(Clock, styles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
$size: 50px; | ||
$border-color: #000; | ||
|
||
.clock { | ||
position: relative; | ||
height: $size; | ||
width: $size; | ||
background: white; | ||
box-sizing: border-box; | ||
border-radius: 100%; | ||
border: 2px solid $border-color; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
margin: auto; | ||
} | ||
|
||
.h-rect { | ||
position: absolute; | ||
width: 8px; | ||
height: 3px; | ||
background: #262626; | ||
} | ||
|
||
.v-rect { | ||
position: absolute; | ||
width: 3px; | ||
height: 8px; | ||
background: #262626; | ||
} | ||
|
||
.top { | ||
composes: v-rect; | ||
left: 0; | ||
right: 0; | ||
margin: 0 auto; | ||
} | ||
|
||
.right { | ||
composes: h-rect; | ||
top: 0; | ||
bottom: 0; | ||
right: 0; | ||
margin: auto 0; | ||
} | ||
|
||
.bottom { | ||
composes: v-rect; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
margin: 0 auto; | ||
} | ||
|
||
.left { | ||
composes: h-rect; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
margin: auto 0; | ||
} | ||
|
||
.center { | ||
height: 6px; | ||
width: 6px; | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
top: 0; | ||
bottom: 0; | ||
margin: auto; | ||
background: #262626; | ||
border-radius: 100%; | ||
} | ||
|
||
.hand { | ||
width: 3px; | ||
height: 100%; | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
margin: 0 auto; | ||
} | ||
|
||
.hand:before { | ||
position: absolute; | ||
content: ""; | ||
} | ||
|
||
.hour { | ||
composes: hand; | ||
animation: time 4s infinite linear; | ||
|
||
&:before { | ||
background: #262626; | ||
height: calc($size * 0.225); | ||
width: 3px; | ||
top: calc($size * 0.225 * 0.9); | ||
} | ||
|
||
} | ||
|
||
.minute { | ||
composes: hand; | ||
animation: time 0.8s infinite linear; | ||
|
||
&:before { | ||
background: #fd1111; | ||
height: 17px; | ||
width: 2px; | ||
top: 26px; | ||
} | ||
|
||
} | ||
|
||
@keyframes time { | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
|
||
} |
Oops, something went wrong.