Skip to content

Commit

Permalink
Updated sample code to better match demos on website
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Oct 22, 2018
1 parent a58b808 commit 70b66ae
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion website/src/code/FixedSizeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FixedSizeGrid as Grid } from 'react-window';

const Cell = ({ columnIndex, rowIndex, style }) => (
<div style={style}>
row {rowIndex}, column {columnIndex}
Item {rowIndex},{columnIndex}
</div>
);

Expand Down
2 changes: 1 addition & 1 deletion website/src/code/VariableSizeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const rowHeights = new Array(1000)

const Cell = ({ columnIndex, rowIndex, style }) => (
<div style={style}>
row {rowIndex}, column {columnIndex}
Item {rowIndex},{columnIndex}
</div>
);

Expand Down
2 changes: 1 addition & 1 deletion website/src/routes/examples/FixedSizeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Cell extends PureComponent {
}
style={style}
>
r{rowIndex}, c{columnIndex}
Item {rowIndex},{columnIndex}
</div>
);
}
Expand Down
6 changes: 4 additions & 2 deletions website/src/routes/examples/FixedSizeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import styles from './shared.module.css';

class Item extends PureComponent {
render() {
const { index, style } = this.props;
const { data, index, style } = this.props;

return (
<div
className={index % 2 ? styles.ListItemOdd : styles.ListItemEven}
style={style}
>
Item {index}
{data} {index}
</div>
);
}
Expand All @@ -36,6 +36,7 @@ export default function() {
className={styles.List}
height={150}
itemCount={1000}
itemData="Row"
itemSize={35}
width={300}
>
Expand All @@ -56,6 +57,7 @@ export default function() {
direction="horizontal"
height={75}
itemCount={1000}
itemData="Column"
itemSize={100}
width={300}
>
Expand Down
2 changes: 1 addition & 1 deletion website/src/routes/examples/ScrollToItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class GridItemRenderer extends PureComponent {
}
style={style}
>
r{rowIndex}, c{columnIndex}
Item {rowIndex},{columnIndex}
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion website/src/routes/examples/VariableSizeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Cell extends PureComponent {
}
style={style}
>
r{rowIndex}, c{columnIndex}
Item {rowIndex},{columnIndex}
</div>
);
}
Expand Down
6 changes: 4 additions & 2 deletions website/src/routes/examples/VariableSizeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const rowSizes = new Array(1000)

class Item extends PureComponent {
render() {
const { index, style } = this.props;
const { data, index, style } = this.props;

return (
<div
className={index % 2 ? styles.ListItemOdd : styles.ListItemEven}
style={style}
>
Item {index}
{data} {index}
</div>
);
}
Expand All @@ -43,6 +43,7 @@ export default function() {
className={styles.List}
height={150}
itemCount={1000}
itemData="Row"
itemSize={index => rowSizes[index]}
width={300}
>
Expand All @@ -63,6 +64,7 @@ export default function() {
direction="horizontal"
height={75}
itemCount={1000}
itemData="Column"
itemSize={index => columnSizes[index]}
width={300}
>
Expand Down

0 comments on commit 70b66ae

Please sign in to comment.