-
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.
Showing
11 changed files
with
202 additions
and
47 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.App { | ||
text-align: center; | ||
|
||
} | ||
|
||
.App-logo { | ||
|
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,27 @@ | ||
import {BrowserRouter, Route, Switch} from 'react-router-dom' | ||
import Postmenu from '../components/postForm'; | ||
import SignUp from '../components/signupComponent'; | ||
import LogIn from '../components/loginComponent'; | ||
import Posts from '../components/posts' | ||
import Clock from '../components/clock' | ||
import React from 'react'; | ||
import FixedNavbarExample from '../components/navbarComponent' | ||
|
||
const RouterComponent = () => { | ||
return ( | ||
<BrowserRouter> | ||
<div> | ||
<FixedNavbarExample /> | ||
<Switch> | ||
<Route path="/" component={LogIn} exact/> | ||
<Route path="/signup" component={SignUp} /> | ||
<Route path="/addmenu" component={Postmenu} /> | ||
<Route path="/menu" component={Posts} /> | ||
<Route path="/clock" component={Clock} /> | ||
</Switch> | ||
</div> | ||
</BrowserRouter> | ||
); | ||
}; | ||
|
||
export default RouterComponent; |
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,40 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
export default class Clock extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
time: this.props.time | ||
}; | ||
this.update = this.updateTime.bind(this); | ||
} | ||
render() { | ||
var time = this.formatTime(this.state.time); | ||
return (<h1>{ time.hours } : { time.minutes } : { time.seconds }</h1>); | ||
} | ||
componentDidMount() { | ||
this.interval = setInterval(this.update, 1000); | ||
} | ||
componentWillUnmount() { | ||
clearInterval(this.interval); | ||
} | ||
formatTime(time) { | ||
var [hours, minutes, seconds] = [ | ||
time.getHours(), | ||
time.getMinutes(), | ||
time.getSeconds() | ||
].map(num => num < 10 ? '0' + num : num); | ||
return { | ||
hours, | ||
minutes, | ||
seconds | ||
}; | ||
} | ||
updateTime() { | ||
this.setState({ | ||
time: new Date(this.state.time.getTime() + 1000) | ||
}); | ||
} | ||
}; | ||
const rest = {} | ||
ReactDOM.render(<Clock time={ new Date() }/>, rest); |
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,63 @@ | ||
import React from 'react'; | ||
import {MDBNavbar, NavLink, MDBNavbarBrand, MDBNavbarNav, MDBNavbarToggler, MDBCollapse, MDBNavItem, MDBIcon } from 'mdbreact'; | ||
|
||
class FixedNavbarExample extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
collapse: false, | ||
}; | ||
this.onClick = this.onClick.bind(this); | ||
} | ||
|
||
onClick() { | ||
this.setState({ | ||
collapse: !this.state.collapse, | ||
}); | ||
} | ||
|
||
render() { | ||
const bgPink = {backgroundColor: '#e91e63'} | ||
return( | ||
<div > | ||
<header> | ||
<MDBNavbar style={bgPink} color="grey darken-3" dark expand="md" scrolling fixed="top"> | ||
<MDBNavbarBrand href="/"> | ||
<strong>FAST FOOD FAST</strong> | ||
</MDBNavbarBrand> | ||
<MDBNavbarToggler onClick={ this.onClick } /> | ||
<MDBCollapse isOpen = { this.state.collapse } navbar> | ||
<MDBNavbarNav left> | ||
<MDBNavItem active> | ||
<NavLink to="/">Home</NavLink> | ||
</MDBNavItem> | ||
<MDBNavItem> | ||
<NavLink to="/menu">Menu</NavLink> | ||
</MDBNavItem> | ||
<MDBNavItem> | ||
<NavLink to="/addmenu">Add Menu</NavLink> | ||
</MDBNavItem> | ||
<MDBNavItem> | ||
<NavLink to="/signup">Signup</NavLink> | ||
</MDBNavItem> | ||
</MDBNavbarNav> | ||
<MDBNavbarNav right> | ||
<MDBNavItem> | ||
<NavLink to="#"><MDBIcon icon="facebook" /></NavLink> | ||
</MDBNavItem> | ||
<MDBNavItem> | ||
<NavLink to="#"><MDBIcon icon="twitter" /></NavLink> | ||
</MDBNavItem> | ||
<MDBNavItem> | ||
<NavLink to="#"><MDBIcon icon="instagram" /></NavLink> | ||
</MDBNavItem> | ||
</MDBNavbarNav> | ||
</MDBCollapse> | ||
</MDBNavbar> | ||
</header> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default FixedNavbarExample; |
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,4 @@ | ||
function sum(a, b) { | ||
return a + b; | ||
} | ||
module.exports = sum; |
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