This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
646383c
commit 5940d56
Showing
9 changed files
with
173 additions
and
31 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
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,67 @@ | ||
import React, { Component } from 'react'; | ||
|
||
class Countdown extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
days: 0, | ||
hours: 0, | ||
minutes: 0, | ||
seconds: 0, | ||
}; | ||
} | ||
|
||
componentWillMount() { | ||
this.getTimeUntil(this.props.deadline); | ||
} | ||
|
||
componentDidMount() { | ||
setInterval(() => this.getTimeUntil(this.props.deadline), 1000); | ||
} | ||
|
||
leading(num) { | ||
return num < 10 ? '0' + num : num; | ||
} | ||
|
||
getTimeUntil(deadline) { | ||
const time = Date.parse(deadline) - Date.parse(new Date()); | ||
if(time < 0) { | ||
this.setState({ days: 0, hours: 0, minutes: 0, seconds: 0 }); | ||
|
||
} else { | ||
const seconds = Math.floor((time/1000)%60); | ||
const minutes = Math.floor((time/1000/60)%60); | ||
const hours = Math.floor((time/(1000*60*60))%24); | ||
const days = Math.floor(time/(1000*60*60*24)); | ||
|
||
this.setState({ days, hours, minutes, seconds }); | ||
} | ||
|
||
} | ||
|
||
render() { | ||
return( | ||
<section id="counter" className="d-flex align-items-center"> | ||
<div className="row m-0 w-100"> | ||
<div className="part p-4 col-6 col-md-3"> | ||
{this.leading(this.state.days)} | ||
<span>Days</span> | ||
</div> | ||
<div className="part p-4 col-6 col-md-3"> | ||
{this.leading(this.state.hours)} | ||
<span>Hours</span> | ||
</div> | ||
<div className="part p-4 col-6 col-md-3"> | ||
{this.leading(this.state.minutes)} | ||
<span>Minutes</span> | ||
</div> | ||
<div className="part p-4 col-6 col-md-3"> | ||
{this.leading(this.state.seconds)} | ||
<span>Seconds</span> | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
} | ||
} | ||
export default Countdown; |
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,28 +1,23 @@ | ||
import React from "react" | ||
import { Link } from "gatsby" | ||
import Github from '../images/github.png' | ||
import MLH from "../images/mlh-logo-white.png" | ||
|
||
|
||
|
||
const Footer = () => ( | ||
<div id="footer"> | ||
<div className="row m-0"> | ||
<div className="col-md-4"> | ||
|
||
</div> | ||
<div className="col-12 col-md-4"> | ||
© Team amFOSS 2019. | ||
</div> | ||
|
||
<div className="col-md-4"> | ||
<div id="footer-menu"> | ||
<a href="/schedule">Privacy</a> | ||
<a href="/schedule">Feedback</a> | ||
<a href="/schedule">Code of conduct</a> | ||
const Footer = () => { | ||
return( | ||
<> | ||
<div className="py-4 text-center text-light">Thank You</div> | ||
<div id="footer-logos" className="row m-0"> | ||
<div className="container d-flex justify-content-center"> | ||
<a href="https://mlh.io/"> | ||
<img className="p-2" src={MLH} alt="MLH" /> | ||
</a> | ||
<a href="https://github.com/"> | ||
<img className="px-2" src={Github} alt="Github" /> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default Footer | ||
</> | ||
) | ||
} | ||
|
||
export default Footer |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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