Adding a clickable link for the name.

This commit is contained in:
Dessalines 2019-02-08 10:36:01 -08:00
parent c257c0a574
commit 0a11e177a8
1 changed files with 14 additions and 4 deletions

View File

@ -124,9 +124,19 @@ export class Search extends Component<any, State> {
{this.state.results.torrents.map(torrent => ( {this.state.results.torrents.map(torrent => (
<tr> <tr>
{ !torrent.name ? ( { !torrent.name ? (
<td class="path_column">{getFileName(torrent.path)}</td> <td className="path_column">
<a class="text-body"
href={magnetLink(torrent.infohash, torrent.path, torrent.index_)}>
{getFileName(torrent.path)}
</a>
</td>
) : ( ) : (
<td class="search-name-cell">{torrent.name}</td> <td class="search-name-cell">
<a class="text-body"
href={magnetLink(torrent.infohash, torrent.name, torrent.index_)}>
{torrent.name}
</a>
</td>
)} )}
<td class="text-right text-muted">{humanFileSize(torrent.size_bytes, true)}</td> <td class="text-right text-muted">{humanFileSize(torrent.size_bytes, true)}</td>
<td class="text-right text-success"><i class="fas fa-fw fa-arrow-up d-none d-sm-inline mr-1"></i>{torrent.seeders}</td> <td class="text-right text-success"><i class="fas fa-fw fa-arrow-up d-none d-sm-inline mr-1"></i>{torrent.seeders}</td>
@ -138,7 +148,7 @@ export class Search extends Component<any, State> {
</td> </td>
<td class="text-right"> <td class="text-right">
<a class="btn btn-sm no-outline p-1" <a class="btn btn-sm no-outline p-1"
href={magnetLink(torrent.infohash, torrent.name, torrent.index_)} href={magnetLink(torrent.infohash, (torrent.name) ? torrent.name : torrent.path, torrent.index_)}
data-balloon="Magnet link" data-balloon="Magnet link"
data-balloon-pos="left"> data-balloon-pos="left">
<i class="fas fa-fw fa-magnet"></i> <i class="fas fa-fw fa-magnet"></i>