channel update submitting state

This commit is contained in:
jessop 2020-06-22 11:19:55 -04:00
commit e3a5d71e34
5 changed files with 17 additions and 6 deletions
ui/component/channelEdit

View file

@ -9,6 +9,7 @@ import {
makeSelectAmountForUri,
makeSelectClaimForUri,
selectUpdateChannelError,
selectUpdatingChannel,
} from 'lbry-redux';
import ChannelPage from './view';
@ -26,6 +27,7 @@ const select = (state, props) => ({
amount: makeSelectAmountForUri(props.uri)(state),
claim: makeSelectClaimForUri(props.uri)(state),
updateError: selectUpdateChannelError(state),
updatingChannel: selectUpdatingChannel(state),
});
const perform = dispatch => ({

View file

@ -27,6 +27,7 @@ type Props = {
updateCover: string => void,
doneEditing: () => void,
updateError: string,
updatingChannel: boolean,
};
function ChannelForm(props: Props) {
@ -47,6 +48,7 @@ function ChannelForm(props: Props) {
updateThumb,
updateCover,
updateError,
updatingChannel,
} = props;
const { claim_id: claimId } = claim;
@ -204,7 +206,11 @@ function ChannelForm(props: Props) {
}}
/>
<div className={'section__actions'}>
<Button button="primary" label={__('Submit')} onClick={handleSubmit} />
<Button
button="primary"
label={updatingChannel ? __('Submitting...') : __('Submit')}
onClick={handleSubmit}
/>
<Button button="link" label={__('Cancel')} onClick={doneEditing} />
</div>
{updateError && updateError.length ? (