Skip to content

Commit

Permalink
v0.7.0: + react-list
Browse files Browse the repository at this point in the history
  • Loading branch information
RubaXa committed Jun 17, 2016
1 parent 2e39552 commit 021955d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-octavius",
"version": "0.6.0",
"version": "0.7.0",
"private": true,
"description": "Боль и унижение!",
"main": "index.js",
Expand Down
24 changes: 16 additions & 8 deletions src/components/Letters.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {bindActionCreators} from 'redux';

import * as selectionActions from '../actions/selection';

import ReactList from 'react-list';
import LettersItem from './LettersItem';

@connect(
Expand All @@ -32,14 +33,21 @@ export default class Letters extends Component {
const fragment = (
<div className="dataset-letters">
<div className={classes}>
<div className="dataset__items">{models.map((model) => {
return <LettersItem
key={model.id}
model={model}
selected={selection[model.id]}
onToggleSelect={(evt) => this.handleToggleSelect(evt, model)}
/>
})}</div>
<ReactList
itemsRenderer={(items, ref) => <div ref={ref} className="dataset__items">{items}</div>}
itemRenderer={(idx, key) => {
const model = models[idx];

return <LettersItem
key={key}
model={model}
selected={selection[model.id]}
onToggleSelect={(evt) => this.handleToggleSelect(evt, model)}
/>
}}
length={models.length}
type="simple"
/>
</div>
</div>
);
Expand Down

0 comments on commit 021955d

Please sign in to comment.