Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement StreamGrid component #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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