-
-
Save notakaos/959094a0bcc2c1338fcf to your computer and use it in GitHub Desktop.
Meteor 1.3 + React Simple Memo Step 7-2
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
meteor npm install --save react-masonry-component |
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
// imports/ui/components/MemoList.js | |
import React from 'react'; | |
import MemoItem from './MemoItem'; | |
import Masonry from 'react-masonry-component'; | |
const masonryOptions = { | |
transitionDuration: 200, | |
}; | |
export default class MemoList extends React.Component { | |
render() { | |
const { memos, removeMemo, updateMemoContent } = this.props; | |
return ( | |
<div className="memo-list"> | |
<Masonry options={masonryOptions}> | |
{memos.map(memo => ( | |
<MemoItem | |
key={memo._id} | |
memo={memo} | |
removeMemo={removeMemo} | |
updateMemoContent={updateMemoContent} | |
/> | |
))} | |
</Masonry> | |
</div> | |
); | |
} | |
} | |
MemoList.propTypes = { | |
memos: React.PropTypes.array.isRequired, | |
removeMemo: React.PropTypes.func.isRequired, | |
updateMemoContent: React.PropTypes.func.isRequired, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment