comments on lbry.tv

This commit is contained in:
Sean Yesmunt 2019-10-28 14:53:59 -04:00
parent 7376500832
commit 31d4f9614c
5 changed files with 12 additions and 7 deletions

View file

@ -4,7 +4,6 @@ import React, { useEffect, useState } from 'react';
import { FormField, Form } from 'component/common/form';
import Button from 'component/button';
import ChannelSection from 'component/selectChannel';
import UnsupportedOnWeb from 'component/common/unsupported-on-web';
import usePersistedState from 'effects/use-persisted-state';
type Props = {
@ -42,8 +41,6 @@ export function CommentCreate(props: Props) {
return (
<section>
<UnsupportedOnWeb type="feature" />
{/* @if TARGET='app' */}
{commentAck !== true && (
<div>
<p>{__('A few things to know before participating in the comment alpha:')}</p>
@ -94,7 +91,6 @@ export function CommentCreate(props: Props) {
</div>
</Form>
)}
{/* @endif */}
</section>
);
}

View file

@ -24,6 +24,7 @@ import SelectThumbnail from 'component/selectThumbnail';
import Card from 'component/common/card';
type Props = {
disabled: boolean,
tags: Array<Tag>,
publish: PublishParams => void,
filePath: ?string,
@ -82,6 +83,7 @@ function PublishForm(props: Props) {
isStillEditing,
tags,
publish,
disabled = false,
} = props;
const formDisabled = (!filePath && !editingURI) || publishing;
// If they are editing, they don't need a new file chosen
@ -130,7 +132,7 @@ function PublishForm(props: Props) {
return (
<Fragment>
<PublishFile disabled={publishing} />
<PublishFile disabled={disabled || publishing} />
<div className={classnames({ 'card--disabled': formDisabled })}>
<PublishText disabled={formDisabled} />
<Card actions={<SelectThumbnail />} />

View file

@ -7,11 +7,13 @@ import {
doFetchChannelListMine,
doCreateChannel,
} from 'lbry-redux';
import { selectUserVerifiedEmail } from 'lbryinc';
const select = state => ({
channels: selectMyChannelClaims(state),
fetchingChannels: selectFetchingMyChannels(state),
balance: selectBalance(state),
emailVerified: selectUserVerifiedEmail(state),
});
const perform = dispatch => ({

View file

@ -16,6 +16,7 @@ type Props = {
createChannel: (string, number) => Promise<any>,
fetchChannelListMine: () => void,
fetchingChannels: boolean,
emailVerified: boolean,
};
type State = {
@ -49,7 +50,11 @@ class ChannelSection extends React.PureComponent<Props, State> {
}
componentDidMount() {
const { channels, fetchChannelListMine, fetchingChannels } = this.props;
const { channels, fetchChannelListMine, fetchingChannels, emailVerified } = this.props;
if (IS_WEB && !emailVerified) {
return;
}
if ((!channels || !channels.length) && !fetchingChannels) {
fetchChannelListMine();
}

View file

@ -63,7 +63,7 @@ function PublishPage(props: Props) {
</section>
</Fragment>
)}
<PublishForm scrollToTop={scrollToTop} />
<PublishForm scrollToTop={scrollToTop} disabled={balance === 0} />
</Page>
);
}