fix(feed): fix feed build

This commit is contained in:
Alexey Kasyanchuk
2018-06-13 16:37:22 +03:00
parent 027be8c3f3
commit 88c3b3e3db
4 changed files with 57 additions and 9 deletions

36
src/app/feed.js Normal file
View File

@ -0,0 +1,36 @@
import React, { Component } from 'react';
import TorrentLine from './torrent'
import {List} from 'material-ui/List';
import Divider from 'material-ui/Divider';
import Subheader from 'material-ui/Subheader';
export default class RecentTorrents extends Component {
constructor() {
super()
this.torrents = [];
}
componentDidMount() {
window.torrentSocket.emit('feed', window.customLoader((data) => {
if(data) {
this.torrents = data;
console.log(data)
this.forceUpdate();
}
}))
}
render() {
return (
<List className='animated torrents-container'>
<Subheader className='recent-title' inset={true}>
{__('Feed')}
</Subheader>
<Divider />
{
this.torrents.map((torrent, index) =>{
return <TorrentLine key={index} torrent={torrent} />;
})
}
</List>
);
}
}