Skip to content

Instantly share code, notes, and snippets.

@thiagoferreiraw
Last active November 9, 2018 12:05
Show Gist options
  • Save thiagoferreiraw/5cc73ce8dead3228d0cf9139e7042f76 to your computer and use it in GitHub Desktop.
Save thiagoferreiraw/5cc73ce8dead3228d0cf9139e7042f76 to your computer and use it in GitHub Desktop.
React Tests - Medium
import React, { Component } from 'react';
import PropTypes from "prop-types"
import Home from "./Home"
const fakeDatabase = {
"Heisenberg": [
"8am - Chemistry classes at school",
"12:30pm - Meet Jesse for lunch",
"15pm - Meet Gus at the Pollos Hermanos",
"20pm - Dinner by the pool with Hank and Marie"
],
"GusFring": [
"8am - Meeting with the DEA",
"15pm - Meet Walter at the Pollos Hermanos",
]
}
class App extends Component {
static propTypes = {
isLoggedIn: PropTypes.bool,
username: PropTypes.string
}
render() {
const { isLoggedIn, username } = this.props
return (
<div className="App">
{
isLoggedIn
? <Home username={username} tasks={fakeDatabase[username]} />
: <p>Hello, visitor. Sign in to continue.</p>
}
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment