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
import React, {Component} from 'react' | |
import Modal from '../components/Modal' | |
class Home extends Component { | |
constructor () { | |
super() | |
this.openModal = this.openModal.bind(this) | |
this.closeModal = this.closeModal.bind(this) |
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
import React, {Component, PropTypes} from 'react' | |
const Modal = ({onClose}) => ( | |
<div id="modal"> | |
<form> | |
<input type="text" placeholder="Your e-mail" /> | |
<textarea placeholder="What are your thoughts?" /> | |
<button onClick={onClose}>Close</button> |
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
<Home> | |
<Header /> | |
<Body> | |
<Sidebar /> | |
<Content /> | |
</Body> | |
<Footer /> | |
</Home> |
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
import React, {Component} from 'react' | |
import {Header, Sidebar, Body, Content, Footer} from './containers' | |
import Modal from '../components/Modal' | |
class Home extends Component { | |
constructor () { | |
super() | |
this.openModal = this.openModal.bind(this) |
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
import React from 'react' | |
const Dropdown = ({onClickRegisterButton}) => ( | |
<ul> | |
<li>One</li> | |
<li onClick={onClickRegisterButton}>Two</li> | |
<li>Three</li> | |
</ul> | |
) |
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
import React from 'react' | |
const IMAGES = [1, 2, 3] | |
const Lightbox = ({imageUrl, onPrev, onNext}) => ( | |
return ( | |
<div> | |
<button onClick={onPrev}>Previous</button> | |
<img src={imageUrl} /> |
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
import React from 'react' | |
class Lightbox extends Component { | |
constructor () { | |
super() | |
this.prev = this.prev.bind(this) | |
this.next = this.next.bind(this) | |
} |
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
const todos = (state = INITIAL_STATE, action) => { | |
switch (action.type) { | |
case ADD_TODO: | |
return [...state.todos, action.todo] | |
case REMOVE_TODO: | |
return state.todos.filter(todo => todo.id !== action.todo.id) | |
default: | |
return state | |
} | |
} |