Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit a88a09b

Browse files
author
M-ZubairAhmed
committed
https://github.com/coderplex/coderplex/pull/11#issuecomment-336893097
1 parent 4127d06 commit a88a09b

File tree

13 files changed

+177
-177
lines changed

13 files changed

+177
-177
lines changed

components/count-down.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
import React, { Component } from 'react'
2-
import PropTypes from 'prop-types'
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
33

44
class Countdown extends Component {
55
constructor(props) {
6-
super(props)
6+
super(props);
77

88
this.state = {
99
days: 0,
1010
hours: 0,
1111
min: 0,
1212
sec: 0,
13-
}
13+
};
1414
}
1515

1616
componentDidMount() {
1717
// Update every second
1818
this.interval = setInterval(() => {
19-
const date = this.calculateCountdown(this.props.date)
20-
if (date) this.setState(date)
21-
else this.stop()
22-
}, 1000)
19+
const date = this.calculateCountdown(this.props.date);
20+
if (date) this.setState(date);
21+
else this.stop();
22+
}, 1000);
2323
}
2424

2525
componentWillUnmount() {
26-
this.stop()
26+
this.stop();
2727
}
2828

2929
calculateCountdown(endDate) {
30-
let diff = (Date.parse(new Date(endDate)) - Date.parse(new Date())) / 1000
30+
let diff = (Date.parse(new Date(endDate)) - Date.parse(new Date())) / 1000;
3131

3232
// Clear countdown when date is reached
33-
if (diff <= 0) return false
33+
if (diff <= 0) return false;
3434

3535
const timeLeft = {
3636
years: 0,
@@ -39,47 +39,47 @@ class Countdown extends Component {
3939
min: 0,
4040
sec: 0,
4141
millisec: 0,
42-
}
42+
};
4343

4444
// Calculate time difference between now and expected date
4545
if (diff >= 365.25 * 86400) {
4646
// 365.25 * 24 * 60 * 60
47-
timeLeft.years = Math.floor(diff / (365.25 * 86400))
48-
diff -= timeLeft.years * 365.25 * 86400
47+
timeLeft.years = Math.floor(diff / (365.25 * 86400));
48+
diff -= timeLeft.years * 365.25 * 86400;
4949
}
5050
if (diff >= 86400) {
5151
// 24 * 60 * 60
52-
timeLeft.days = Math.floor(diff / 86400)
53-
diff -= timeLeft.days * 86400
52+
timeLeft.days = Math.floor(diff / 86400);
53+
diff -= timeLeft.days * 86400;
5454
}
5555
if (diff >= 3600) {
5656
// 60 * 60
57-
timeLeft.hours = Math.floor(diff / 3600)
58-
diff -= timeLeft.hours * 3600
57+
timeLeft.hours = Math.floor(diff / 3600);
58+
diff -= timeLeft.hours * 3600;
5959
}
6060
if (diff >= 60) {
61-
timeLeft.min = Math.floor(diff / 60)
62-
diff -= timeLeft.min * 60
61+
timeLeft.min = Math.floor(diff / 60);
62+
diff -= timeLeft.min * 60;
6363
}
64-
timeLeft.sec = diff
64+
timeLeft.sec = diff;
6565

66-
return timeLeft
66+
return timeLeft;
6767
}
6868

6969
stop() {
70-
clearInterval(this.interval)
70+
clearInterval(this.interval);
7171
}
7272

7373
addLeadingZeros(value) {
74-
value = String(value)
74+
value = String(value);
7575
while (value.length < 2) {
76-
value = '0' + value
76+
value = '0' + value;
7777
}
78-
return value
78+
return value;
7979
}
8080

8181
render() {
82-
const countDown = this.state
82+
const countDown = this.state;
8383

8484
return (
8585
<div className="countdown">
@@ -125,16 +125,16 @@ class Countdown extends Component {
125125
}
126126
`}</style>
127127
</div>
128-
)
128+
);
129129
}
130130
}
131131

132132
Countdown.propTypes = {
133133
date: PropTypes.string.isRequired,
134-
}
134+
};
135135

136136
Countdown.defaultProps = {
137137
date: new Date(),
138-
}
138+
};
139139

140-
export default Countdown
140+
export default Countdown;

components/footer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react'
2-
import FaFacebook from 'react-icons/lib/fa/facebook'
3-
import FaYoutube from 'react-icons/lib/fa/youtube-play'
4-
import FaGithub from 'react-icons/lib/fa/github-alt'
5-
import FaInstagram from 'react-icons/lib/fa/instagram'
1+
import React from 'react';
2+
import FaFacebook from 'react-icons/lib/fa/facebook';
3+
import FaYoutube from 'react-icons/lib/fa/youtube-play';
4+
import FaGithub from 'react-icons/lib/fa/github-alt';
5+
import FaInstagram from 'react-icons/lib/fa/instagram';
66

77
export default () => (
88
<footer>
@@ -80,4 +80,4 @@ export default () => (
8080
}
8181
`}</style>
8282
</footer>
83-
)
83+
);

components/global-styles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react'
1+
import React from 'react';
22

33
export default () => (
44
<div>
@@ -51,4 +51,4 @@ export default () => (
5151
}
5252
`}</style>
5353
</div>
54-
)
54+
);

components/head.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react'
2-
import Head from 'next/head'
1+
import React from 'react';
2+
import Head from 'next/head';
33

44
export default ({ title }) => (
55
<Head>
@@ -50,4 +50,4 @@ export default ({ title }) => (
5050
<meta property="og:site_name" content="coderplex" />
5151
<meta property="og:description" content="coderplex" />
5252
</Head>
53-
)
53+
);

components/header.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import React from 'react'
2-
import Headroom from 'react-headroom'
3-
import NProgress from 'nprogress'
4-
import Router from 'next/router'
5-
import Link from 'next/link'
6-
import { Dropdown } from 'semantic-ui-react'
1+
import React from 'react';
2+
import Headroom from 'react-headroom';
3+
import NProgress from 'nprogress';
4+
import Router from 'next/router';
5+
import Link from 'next/link';
6+
import { Dropdown } from 'semantic-ui-react';
77

8-
import { logout } from '../utils/authenticate'
9-
import GlobalStyles from './global-styles'
10-
import Head from './head'
8+
import { logout } from '../utils/authenticate';
9+
import GlobalStyles from './global-styles';
10+
import Head from './head';
1111

1212
Router.onRouteChangeStart = () => {
13-
NProgress.start()
14-
}
13+
NProgress.start();
14+
};
1515

1616
Router.onRouteChangeComplete = () => {
17-
NProgress.done()
18-
}
17+
NProgress.done();
18+
};
1919

2020
Router.onRouteChangeError = () => {
21-
NProgress.done()
22-
}
21+
NProgress.done();
22+
};
2323

2424
export default props => {
2525
const title =
2626
props.url.pathname === '/'
2727
? 'Home'
28-
: props.url.pathname.split('/')[1].toUpperCase()
28+
: props.url.pathname.split('/')[1].toUpperCase();
2929
const navItems = [
3030
{
3131
title: 'Home',
@@ -59,7 +59,7 @@ export default props => {
5959
title: 'Login/Register',
6060
path: '/login',
6161
},
62-
].filter(item => (props.username ? item.path !== '/login' : true))
62+
].filter(item => (props.username ? item.path !== '/login' : true));
6363
return (
6464
<Headroom>
6565
<header>
@@ -89,7 +89,7 @@ export default props => {
8989
</a>
9090
</Link>
9191
</li>
92-
)
92+
);
9393
})}
9494
{props.username && (
9595
<li className="nav__linkItem">
@@ -206,5 +206,5 @@ export default props => {
206206
}
207207
`}</style>
208208
</Headroom>
209-
)
210-
}
209+
);
210+
};

pages/jobs/index.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import React from 'react'
2-
import Link from 'next/link'
3-
import { Input, Dropdown, Button, Header, Icon } from 'semantic-ui-react'
4-
import FaBuilding from 'react-icons/lib/fa/building'
5-
import FaLocation from 'react-icons/lib/fa/map-marker'
1+
import React from 'react';
2+
import Link from 'next/link';
3+
import { Input, Dropdown, Button, Header, Icon } from 'semantic-ui-react';
4+
import FaBuilding from 'react-icons/lib/fa/building';
5+
import FaLocation from 'react-icons/lib/fa/map-marker';
66
// Import FaArrowRight from 'react-icons/lib/fa/angle-right'
77

8-
import publicPage from '../../hocs/public-page'
9-
import { client as feathersClient } from '../../utils/feathers-client'
10-
import truncateString from '../../utils'
8+
import publicPage from '../../hocs/public-page';
9+
import { client as feathersClient } from '../../utils/feathers-client';
10+
import truncateString from '../../utils';
1111

12-
const _jobTypes = ['FullTime', 'PartTime', 'Remote', 'Consulting', 'Freelance']
12+
const _jobTypes = ['FullTime', 'PartTime', 'Remote', 'Consulting', 'Freelance'];
1313

1414
const jobTypes = _jobTypes.map(type => ({
1515
key: type,
1616
text: type,
1717
value: type,
18-
}))
18+
}));
1919

2020
const technologies = [
2121
{ key: 'all', text: 'All', value: 'all' },
@@ -34,7 +34,7 @@ const technologies = [
3434
{ key: 'ruby', text: 'Ruby', value: 'ruby' },
3535
{ key: 'ui', text: 'UI Design', value: 'ui' },
3636
{ key: 'ux', text: 'User Experience', value: 'ux' },
37-
]
37+
];
3838

3939
const Jobs = props => (
4040
<div>
@@ -124,7 +124,7 @@ const Jobs = props => (
124124
</Link>
125125
</div>
126126
</div>
127-
)
127+
);
128128
})}
129129
</div>
130130
{/* <div className="jobs__more">
@@ -364,7 +364,7 @@ const Jobs = props => (
364364
}
365365
`}</style>
366366
</div>
367-
)
367+
);
368368

369369
Jobs.getInitialProps = async () => {
370370
const jobs = await feathersClient
@@ -376,8 +376,8 @@ Jobs.getInitialProps = async () => {
376376
},
377377
},
378378
})
379-
.then(res => res.data)
380-
return { jobs }
381-
}
379+
.then(res => res.data);
380+
return { jobs };
381+
};
382382

383-
export default publicPage(Jobs)
383+
export default publicPage(Jobs);

0 commit comments

Comments
 (0)