improvements for channel Tile
This commit is contained in:
parent
3374c8ba39
commit
c20ecd5f36
1 changed files with 21 additions and 15 deletions
|
@ -1,4 +1,6 @@
|
|||
import React from "react";
|
||||
import lbryuri from "lbryuri.js";
|
||||
import CardMedia from "component/cardMedia";
|
||||
import { TruncatedText, BusyMessage } from "component/common.js";
|
||||
|
||||
class ChannelTile extends React.PureComponent {
|
||||
|
@ -18,27 +20,31 @@ class ChannelTile extends React.PureComponent {
|
|||
|
||||
render() {
|
||||
const { navigate, totalItems, uri } = this.props;
|
||||
const { name, claimId } = lbryuri.parse(uri);
|
||||
|
||||
let onClick = () => navigate("/show", { uri });
|
||||
|
||||
return (
|
||||
<section className="file-tile card">
|
||||
<div onClick={onClick} className="card__link">
|
||||
<div className="file-tile__content">
|
||||
<div className="card__title-primary">
|
||||
<h3>
|
||||
<TruncatedText lines={1}>{uri}</TruncatedText>
|
||||
</h3>
|
||||
</div>
|
||||
<div className="card__content card__subtext">
|
||||
{isNaN(totalItems) &&
|
||||
<BusyMessage message={__("Resolving channel")} />}
|
||||
{totalItems > 0 &&
|
||||
<span>
|
||||
This is a channel with over {totalItems} items inside of it.
|
||||
</span>}
|
||||
{totalItems === 0 &&
|
||||
<span className="empty">This is an empty channel.</span>}
|
||||
<div className={"card__inner file-tile__row"}>
|
||||
<CardMedia title={name} thumbnail={null} />
|
||||
<div className="file-tile__content">
|
||||
<div className="card__title-primary">
|
||||
<h3>
|
||||
<TruncatedText lines={1}>{name}</TruncatedText>
|
||||
</h3>
|
||||
</div>
|
||||
<div className="card__content card__subtext">
|
||||
{isNaN(totalItems) &&
|
||||
<BusyMessage message={__("Resolving channel")} />}
|
||||
{totalItems > 0 &&
|
||||
<span>
|
||||
This is a channel with over {totalItems} items inside of it.
|
||||
</span>}
|
||||
{totalItems === 0 &&
|
||||
<span className="empty">This is an empty channel.</span>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue