Skip to content

Commit

Permalink
implement StreamGrid component
Browse files Browse the repository at this point in the history
  • Loading branch information
kenany committed Jan 12, 2017
1 parent ee4b99b commit a6bd255
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
32 changes: 21 additions & 11 deletions src/components/Strims.jsx
@@ -1,18 +1,28 @@
import React, { PropTypes } from 'react';
import { Link } from 'react-router';
import React from 'react';

import MainLayout from './MainLayout';
import StreamThumbnail from './StreamThumbnail';


const Strims = props =>
<MainLayout>
<div>
You are at {props.location.pathname}
const Strims = props => {
const { streams } = props;

let grid = null;
if (streams && streams.length) {
grid = streams.map(stream => {
return <StreamThumbnail name = {stream.channel}
thumbnail = {stream.image_url} url = {stream.url}
service = {stream.platform} viewers = {stream.rustlers}
key = {stream.url}
/>
});
}

return <MainLayout>
<div className='strims'>
{grid}
</div>
<div><Link to='/one'>one</Link></div>
<div><Link to='/two'>two</Link></div>
<div><Link to='/three'>three</Link></div>
</MainLayout>
;
</MainLayout>;
};

export default Strims;
5 changes: 2 additions & 3 deletions src/routes.jsx
@@ -1,10 +1,9 @@
import * as React from 'react';
import { Route, Redirect, IndexRedirect, IndexRoute } from 'react-router';
import React from 'react';
import { Route, IndexRoute } from 'react-router';

import Strims from './components/Strims';
import Error404 from './components/Error404';


const routes =
<Route path='/'>
<IndexRoute component={Strims} />
Expand Down

0 comments on commit a6bd255

Please sign in to comment.