lbry-desktop/ui/component/channelDiscussion/view.jsx

30 lines
800 B
React
Raw Normal View History

// @flow
import React from 'react';
2021-02-04 06:45:49 +01:00
import Empty from 'component/common/empty';
import { lazyImport } from 'util/lazyImport';
const CommentsList = lazyImport(() => import('component/commentsList' /* webpackChunkName: "comments" */));
type Props = {
uri: string,
linkedCommentId?: string,
2021-02-05 00:00:07 +01:00
commentsDisabled: boolean,
};
function ChannelDiscussion(props: Props) {
const { uri, linkedCommentId, commentsDisabled } = props;
2021-02-05 00:00:07 +01:00
if (commentsDisabled) {
return <Empty text={__('This channel has disabled comments on their page.')} />;
2021-02-04 06:45:49 +01:00
}
return (
<section className="section">
<React.Suspense fallback={null}>
<CommentsList uri={uri} linkedCommentId={linkedCommentId} commentsAreExpanded />
</React.Suspense>
</section>
);
}
export default ChannelDiscussion;