mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
Handle remaining usages of MarkdownPreview
- Channel About - description: seems handy to have a preview, so pulled in the "allowed" logic. - email: shouldn't render preview at all - website: shouldn't render preview at all - Publish Preview: - description: there's not enough height anyway, so don't render preview.
This commit is contained in:
parent
0d850742f5
commit
469e9cddc0
3 changed files with 10 additions and 8 deletions
|
@ -1,9 +1,10 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { makeSelectMetadataItemForUri, makeSelectClaimForUri } from 'lbry-redux';
|
import { makeSelectMetadataItemForUri, makeSelectClaimForUri, makeSelectStakedLevelForChannelUri } from 'lbry-redux';
|
||||||
import ChannelAbout from './view';
|
import ChannelAbout from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
|
stakedLevel: makeSelectStakedLevelForChannelUri(props.uri)(state),
|
||||||
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
||||||
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
|
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
|
||||||
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),
|
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),
|
||||||
|
|
|
@ -17,6 +17,7 @@ type Props = {
|
||||||
email: ?string,
|
email: ?string,
|
||||||
website: ?string,
|
website: ?string,
|
||||||
languages: Array<string>,
|
languages: Array<string>,
|
||||||
|
stakedLevel?: number,
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatEmail = (email: string) => {
|
const formatEmail = (email: string) => {
|
||||||
|
@ -29,7 +30,7 @@ const formatEmail = (email: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
function ChannelAbout(props: Props) {
|
function ChannelAbout(props: Props) {
|
||||||
const { claim, uri, description, email, website, languages } = props;
|
const { claim, uri, description, email, website, languages, stakedLevel } = props;
|
||||||
const claimId = claim && claim.claim_id;
|
const claimId = claim && claim.claim_id;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -40,7 +41,7 @@ function ChannelAbout(props: Props) {
|
||||||
<>
|
<>
|
||||||
<label>{__('Description')}</label>
|
<label>{__('Description')}</label>
|
||||||
<div className="media__info-text media__info-text--constrained">
|
<div className="media__info-text media__info-text--constrained">
|
||||||
<MarkdownPreview content={description} />
|
<MarkdownPreview content={description} stakedLevel={stakedLevel} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
@ -48,7 +49,7 @@ function ChannelAbout(props: Props) {
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<label>{__('Contact')}</label>
|
<label>{__('Contact')}</label>
|
||||||
<div className="media__info-text">
|
<div className="media__info-text">
|
||||||
<MarkdownPreview content={formatEmail(email)} />
|
<MarkdownPreview content={formatEmail(email)} simpleLinks />
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
|
@ -56,7 +57,7 @@ function ChannelAbout(props: Props) {
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<label>{__('Site')}</label>
|
<label>{__('Site')}</label>
|
||||||
<div className="media__info-text">
|
<div className="media__info-text">
|
||||||
<MarkdownPreview content={website} />
|
<MarkdownPreview content={website} simpleLinks />
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -34,7 +34,7 @@ type Props = {
|
||||||
publish: (?string, ?boolean) => void,
|
publish: (?string, ?boolean) => void,
|
||||||
closeModal: () => void,
|
closeModal: () => void,
|
||||||
enablePublishPreview: boolean,
|
enablePublishPreview: boolean,
|
||||||
setEnablePublishPreview: boolean => void,
|
setEnablePublishPreview: (boolean) => void,
|
||||||
isStillEditing: boolean,
|
isStillEditing: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class ModalPublishPreview extends React.PureComponent<Props> {
|
||||||
|
|
||||||
const descriptionValue = description ? (
|
const descriptionValue = description ? (
|
||||||
<div className="media__info-text-preview">
|
<div className="media__info-text-preview">
|
||||||
<MarkdownPreview content={description} />
|
<MarkdownPreview content={description} simpleLinks />
|
||||||
</div>
|
</div>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ class ModalPublishPreview extends React.PureComponent<Props> {
|
||||||
|
|
||||||
const tagsValue =
|
const tagsValue =
|
||||||
// Do nothing for onClick(). Setting to 'null' results in "View Tag" action -- we don't want to leave the modal.
|
// Do nothing for onClick(). Setting to 'null' results in "View Tag" action -- we don't want to leave the modal.
|
||||||
tags.map(tag => <Tag key={tag.name} title={tag.name} name={tag.name} type={'flow'} onClick={() => {}} />);
|
tags.map((tag) => <Tag key={tag.name} title={tag.name} name={tag.name} type={'flow'} onClick={() => {}} />);
|
||||||
|
|
||||||
const depositValue = bid ? <LbcSymbol postfix={`${bid}`} size={14} /> : <p>---</p>;
|
const depositValue = bid ? <LbcSymbol postfix={`${bid}`} size={14} /> : <p>---</p>;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue