forked from gpbl/isomorphic500
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FeaturedPage.js
38 lines (32 loc) · 883 Bytes
/
FeaturedPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React, { PropTypes } from "react";
import { connectToStores } from "fluxible-addons-react";
import Thumbnail from "../components/Thumbnail";
if (process.env.BROWSER) {
require("../style/ThumbnailCollection.scss");
}
@connectToStores(["FeaturedStore"], context => {
const ids = context.getStore("FeaturedStore").getFeaturedPhotos();
const photos = context.getStore("PhotoStore").getMultiple(ids);
return {
photos: photos
};
})
export default class FeaturedPage extends React.Component {
static propTypes = {
photos: PropTypes.array.isRequired
}
render() {
const { photos } = this.props;
return (
<div>
<div className="ThumbnailCollection">
{
photos.map(photo =>
<Thumbnail key={ photo.id } size="small" photo={ photo } />
)
}
</div>
</div>
);
}
}