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

got frustrated about no claim id on channels and went wild #3831

Merged
merged 1 commit into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion static/app-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1033,5 +1033,13 @@
"Commenting is in alpha. During the alpha, all comments are sent to a LBRY, Inc. server, not the LBRY network itself.": "Commenting is in alpha. During the alpha, all comments are sent to a LBRY, Inc. server, not the LBRY network itself.",
"Deleting or editing comments is not currently possible. Please be mindful of this when posting.": "Deleting or editing comments is not currently possible. Please be mindful of this when posting.",
"When the alpha ends, we will attempt to transition comments, but do not promise to do so.": "When the alpha ends, we will attempt to transition comments, but do not promise to do so.",
"More Channels": "More Channels"
"More Channels": "More Channels",
"You aren’t blocking any channels": "You aren’t blocking any channels",
"When you block a channel, all content from that channel will be hidden.": "When you block a channel, all content from that channel will be hidden.",
"View top claims for %normalized_uri%": "View top claims for %normalized_uri%",
"Staked LBC": "Staked LBC",
"view all claims": "view all claims",
"Top claims at lbry://%name%": "Top claims at lbry://%name%",
"Last Updated": "Last Updated",
"Total Publishes": "Total Publishes"
}
8 changes: 3 additions & 5 deletions ui/component/channelAbout/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { connect } from 'react-redux';
import { makeSelectMetadataItemForUri } from 'lbry-redux';
import { makeSelectMetadataItemForUri, makeSelectClaimForUri } from 'lbry-redux';
import ChannelAbout from './view';

const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),
});

export default connect(
select,
null
)(ChannelAbout);
export default connect(select, null)(ChannelAbout);
52 changes: 43 additions & 9 deletions ui/component/channelAbout/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
import React, { Fragment } from 'react';
import MarkdownPreview from 'component/common/markdown-preview';
import ClaimTags from 'component/claimTags';
import CreditAmount from 'component/common/credit-amount';
import Button from 'component/button';
import * as PAGES from 'constants/pages';
import DateTime from 'component/dateTime';

type Props = {
claim: ChannelClaim,
uri: string,
description: ?string,
email: ?string,
Expand All @@ -19,14 +24,12 @@ const formatEmail = (email: string) => {
return null;
};

function ChannelContent(props: Props) {
const { uri, description, email, website } = props;
const showAbout = description || email || website;
function ChannelAbout(props: Props) {
const { claim, uri, description, email, website } = props;

return (
<section className="section">
{!showAbout && <h2 className="main--empty empty">{__('Nothing here yet')}</h2>}
{showAbout && (
<div className="card">
<section className="section card--section">
<Fragment>
{description && (
<div className="media__info-text media__info-text--constrained">
Expand Down Expand Up @@ -54,10 +57,41 @@ function ChannelContent(props: Props) {
<div className="media__info-text">
<ClaimTags uri={uri} type="large" />
</div>

<label>{__('Total Publishes')}</label>
<div className="media__info-text">{claim.meta.claims_in_channel}</div>

<label>{__('Last Updated')}</label>
<div className="media__info-text">
<DateTime timeAgo uri={uri} />
</div>

<label>{__('Claim ID')}</label>
<div className="media__info-text">
<div className="media__info-text media__info-text--constrained">{claim.claim_id}</div>
</div>

<label>{__('Staked LBC')}</label>
<div className="media__info-text">
<CreditAmount
badge={false}
amount={parseFloat(claim.amount) + parseFloat(claim.meta.support_amount)}
precision={8}
/>{' '}
(
<Button
button="link"
label={__('view other claims at lbry://%name%', {
name: claim.name,
})}
navigate={`/$/${PAGES.TOP}?name=${claim.name}`}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this link does what you want. It shows all claims for that claim name, which will just be other channels with the same name?
http://lbry.tv/$/top?name=@kauffj

/>
)
</div>
</Fragment>
)}
</section>
</section>
</div>
);
}

export default ChannelContent;
export default ChannelAbout;
Loading