lbry-desktop/src/ui/component/channelAbout/view.jsx

46 lines
1.2 KiB
React
Raw Normal View History

2019-05-07 04:35:04 +02:00
// @flow
import React, { Fragment } from 'react';
import MarkdownPreview from 'component/common/markdown-preview';
2019-05-07 04:35:04 +02:00
type Props = {
description: ?string,
email: ?string,
website: ?string,
};
function ChannelContent(props: Props) {
const { description, email, website } = props;
const showAbout = description || email || website;
return (
<section>
{!showAbout && <h2 className="empty">{__('Nothing here yet')}</h2>}
{showAbout && (
<Fragment>
{description && (
<div className="media__info-text">
<MarkdownPreview content={description} promptLinks />
</div>
)}
2019-05-07 04:35:04 +02:00
{email && (
<Fragment>
<div className="media__info-title">{__('Contact')}</div>
<div className="media__info-text">{email}</div>
</Fragment>
)}
{website && (
<Fragment>
<div className="media__info-title">{__('Site')}</div>
<div className="media__info-text">
<MarkdownPreview content={website} promptLinks />
</div>
2019-05-07 04:35:04 +02:00
</Fragment>
)}
</Fragment>
)}
</section>
);
}
export default ChannelContent;