начало базовых исправлений

This commit is contained in:
Alexey Kasyanchuk
2017-01-02 04:33:50 +03:00
parent 92a68abafe
commit 4843b6eef6
4 changed files with 34 additions and 9 deletions

View File

@ -1,4 +1,15 @@
import React, { Component } from 'react';
import formatBytes from './format-bytes'
const TorrentLine = (props) => {
const torrent = props.torrent;
return (
<div className='clickable row inline fs0-85 pad0-25' onClick={() => window.router('/torrent/' + torrent.hash)}>
<div>{torrent.name}</div>
<div style={{marginLeft: '8px'}}>({formatBytes(torrent.size, 1)})</div>
</div>
)
}
export default class RecentTorrents extends Component {
constructor() {
@ -22,11 +33,7 @@ export default class RecentTorrents extends Component {
<div className="list column">
{
this.torrents.map((torrent, index) =>{
return(
<div key={index} className='clickable' onClick={() => window.router('/torrent/' + torrent.hash)}>
{torrent.name}
</div>
);
return <TorrentLine key={index} torrent={torrent} />;
})
}
</div>