This file contains hidden or 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
// Profile Picture Class | |
// in this example we're assuming you know the distinction | |
// between high order and presentational components | |
const ProfilePictureContainer = class ProfilePictureContainer extends React.Component { | |
constructor() { | |
super(); | |
} | |
// Use get meteor data to put our reactive data | |
// in one spot |
This file contains hidden or 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 ProfileAvatarComponent = ({profilePhoto, role}) => { | |
return ( | |
<div className="img-circle"> | |
<div className="grey-outline"> | |
<img src={profilePhoto} className="img-responsive"/> | |
</div> | |
</div> | |
) | |
} |
This file contains hidden or 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 ProfileAvatarComponent = ({profilePhoto, role}) => { | |
const roleClass = role === 'Admin' ? 'blue-outline' : 'grey-outline'; | |
return ( | |
<div className="img-circle"> | |
<div className={roleClass}> | |
<img src={profilePhoto} className="img-responsive"/> | |
</div> | |
</div> | |
) | |
} |
This file contains hidden or 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 ProfileAvatarComponent = ({profilePhoto, role}) => { | |
const roleClass = roleOutline(role); | |
return ( | |
<div className="img-circle"> | |
<div className={roleClass}> | |
<img src={profilePhoto} className="img-responsive"/> | |
</div> | |
</div> | |
) | |
} |
This file contains hidden or 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
<!-- in client/index.html --> | |
<body> | |
<div id="app"></div> | |
</body> |
This file contains hidden or 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
// in client/components/rootComponent.jsx | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import Store from '../imports/client/store/store'; | |
import TodoApp from '../imports/client/components/TodoApp'; | |
function TodoAppRoot() { | |
return ( | |
<div className="todo-container"> |
This file contains hidden or 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
// in client/components/app.jsx | |
import AddTodo from '../imports/client/components/AddTodo'; | |
import TodoList from '../imports/client/components/TodoList'; | |
import Footer from '../imports/client/components/Footer'; | |
export default function TodoApp() { | |
<div> | |
<AddTodo/> | |
<TodoList/> | |
<Footer/> |
This file contains hidden or 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
// in imports/client/components/AddTodo.jsx | |
import { connect } from 'react-redux'; | |
import addTodo from '../imports/client/actions/addTodo'; | |
function AddTodo({ dispatch }) { | |
let input; | |
return ( | |
<div> |
This file contains hidden or 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'; | |
export default function Todo({onClick,completed,text}) { | |
<li | |
onClick={onClick} | |
style={{ | |
textDecoration: completed ? 'line-through' : 'none' | |
}} | |
> | |
{text} |
This file contains hidden or 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
// in client/components/pagination.jsx | |
import ReactPaginate from 'react-paginate'; | |
export default TodoPagination({handlePageClick, pageCount}) { | |
return ( | |
<div className="paginate"> | |
<ReactPaginate | |
previousLabel={"previous"} | |
nextLabel={"next"} | |
breakLabel={<li className="break"><a href="">...</a></li> |