b20b24bdb6
* Move menu entries & add publish buttons * Save * Separate publish forms * Make new header dynamic for all screen sizes * Save some livestream creation changes * Save more livestream changes * Save * Change publish folder structure * Update paths * Change position of form elements. Again. * Move, add & delete form fields * Clean post form * Clean post form even more * Clean publish post component * Save * Add custom post form state * Move price to additional options * Adjust livestream form * Adjust headers & titles * Update key section * Adjust active header icons * Adjust toggle menu * Save * Adjust active button style * Change active button selector in header * Fix header menu links * Move price section in post form * Adjust instruction text color * Adjust replay table * Revert changes & adjust tag section * Make more form elements dynamic * Finalize additional options section * Update post form * Set mode in upload form * Update livestream form * Add clear button * Make clear button dynamic * Set upload mode * Remove new button * Clean upload form * Show disabled key on livestream form * Remove old key section * Update channel selector for publish forms * Add updated channel selector to publish forms * Add mobile links * Update mobile header * Adjust channel selector on mobile * Adjust livestream form on mobile * Adjust edit links for livestreams * Adjust edit links for posts * Adjust more edit links * Adjust channel selector * Update disabled in livestream form * Add missing change * Fix sign out function * Save * Adjust livestream page on mobile * Adjust tags section on upload page on mobile * Adjust publish links in left navigation on mobile * Add images to accepted filetypes on upload page * Add autofocus to input fields * Add autofocus to all publish forms * Save * Ignore thumbnail api status * Put active thumbnail upload label in card * Fix crashes * Fix flow * Fix licence fields * Adjust wallet in header on smaller screens * Fix channel selector line break on small screens * Fix border radius for some buttons * PublishReleaseDate: fix initial value to reflect what's actually in Redux 'undefined' is a valid value that means "use publish time", but the GUI incorrectly starts off by locking to the mounted timestamp. * Add and hide channel selector on livestream publish page * Fix channel selector on livestream setup page * Fix gif aspect ratio in channel selector * Make layout more dynamic * Fix some edit redirects * Save * Clean publishFile * Fix build errors * Fix more build errors in profile menu button * Remove console logs * Remove post form reducer * Limit publish title length to 200 characters * Remove totalRewardValue from livestreamCreate index * Remove console log * Add tooltip to replay refresh button * Remove scrollToTop function from publish forms * Adjust emty wallet value trigger and add error to livestream publish page * Disable some tabs in edit mode in livestream form * Fix maxLength typo * Remove 'as' label * Remove selectPublishFormValues * Reenable setup tab * Remove inactive line * Remove another inactive line * Remove flow fix * Update label switch logic in confirmation modal Adjust gif margin Adjust gif margin Remove navigate from edit link Remove manual updateLabels execution on init Remove editLabel function Fix labels in publish modal Adjust post livestream setup redirect Remove setOverMaxBitrate from livestream form Clean livestream publish More cleanup Update post livestream creation redirect Bring back edit tab for livestreams Update edit tab Reset form on livestream edit => clear Update label switch logic Readjust channel selector position on mobile * Make some space adjustments for mobile Update livestream edit page on mobile Update action label on publish forms in edit mode * Hide replay options in edit mode in livestream form * Update label switch logic in confirmation modal Adjust gif margin Adjust gif margin Remove navigate from edit link Remove manual updateLabels execution on init Remove editLabel function Fix labels in publish modal Adjust post livestream setup redirect Remove setOverMaxBitrate from livestream form Clean livestream publish More cleanup Update post livestream creation redirect Bring back edit tab for livestreams Update edit tab Reset form on livestream edit => clear Update label switch logic Readjust channel selector position on mobile Make some space adjustments for mobile Update livestream edit page on mobile Update action label on publish forms in edit mode Hide replay options in edit mode in livestream form * Make form titles dynamic * Remove spinner on livestream form * Remove console log * Fix double history push * Fix thumbnail status on post form * Update error message style * Handle publish error button behavior * Clean code * Fix scheduling & date picker * Fix calendar overlap * Add replay selector to livestream claim edit form * Clean code * Disable autocomplete * Show replays in edit & replay tab * Redesign replay picker * Fix design details * Save dynamic replay picker * Fix autoComplete typo * Change label text * Add upload to livestream replay form * Fix scss structure * Add comunity guideline link to publish forms * Fix error * Fix selectThumbnail index * Reset form values on replay source change * Add replay redirect to upload page * Fix publishError state change * Remove label effect from publish confirmation modal * Update labels in publish confirmation modal * Add ? to chaptersButton * Remove doPrepareEdit({ name }) * Bring upload redirect back * Adjust redirects * Save * Update edit redirects * Revert scheduling options * Replace checkboxes for replays with radio * Update form on source change * Rearrange entries in mobile navigation * Change key position on livestream setup page * Change label for livestream update without replay change * Adjust margin below label Co-authored-by: infinite-persistence <inf.persistence@gmail.com>
549 lines
17 KiB
JavaScript
549 lines
17 KiB
JavaScript
// @flow
|
|
|
|
/*
|
|
On submit, this component calls publish, which dispatches doPublishDesktop.
|
|
doPublishDesktop calls lbry-redux Lbry publish method using lbry-redux publish state as params.
|
|
Publish simply instructs the SDK to find the file path on disk and publish it with the provided metadata.
|
|
On web, the Lbry publish method call is overridden in platform/web/api-setup, using a function in platform/web/publish.
|
|
File upload is carried out in the background by that function.
|
|
*/
|
|
|
|
import { SITE_NAME, ENABLE_NO_SOURCE_CLAIMS, SIMPLE_SITE } from 'config';
|
|
import React, { useEffect, useState } from 'react';
|
|
import { buildURI, isURIValid, isNameValid } from 'util/lbryURI';
|
|
import * as THUMBNAIL_STATUSES from 'constants/thumbnail_upload_statuses';
|
|
import Button from 'component/button';
|
|
import ChannelSelect from 'component/channelSelector';
|
|
import classnames from 'classnames';
|
|
import TagsSelect from 'component/tagsSelect';
|
|
import PublishDescription from 'component/publish/shared/publishDescription';
|
|
import PublishAdditionalOptions from 'component/publish/shared/publishAdditionalOptions';
|
|
import PublishFormErrors from 'component/publish/shared/publishFormErrors';
|
|
import PublishStreamReleaseDate from 'component/publish/shared/publishStreamReleaseDate';
|
|
import PublishFile from 'component/publish/upload/publishFile';
|
|
|
|
import SelectThumbnail from 'component/selectThumbnail';
|
|
import Card from 'component/common/card';
|
|
import I18nMessage from 'component/i18nMessage';
|
|
import * as PUBLISH_MODES from 'constants/publish_types';
|
|
import { useHistory } from 'react-router';
|
|
import Spinner from 'component/spinner';
|
|
import { SOURCE_NONE } from 'constants/publish_sources';
|
|
|
|
import * as ICONS from 'constants/icons';
|
|
import Icon from 'component/common/icon';
|
|
|
|
type Props = {
|
|
disabled: boolean,
|
|
tags: Array<Tag>,
|
|
publish: (source?: string | File, ?boolean) => void,
|
|
filePath: string | File,
|
|
fileText: string,
|
|
bid: ?number,
|
|
bidError: ?string,
|
|
editingURI: ?string,
|
|
title: ?string,
|
|
thumbnail: ?string,
|
|
thumbnailError: ?boolean,
|
|
uploadThumbnailStatus: ?string,
|
|
thumbnailPath: ?string,
|
|
description: ?string,
|
|
language: string,
|
|
releaseTimeError: ?string,
|
|
nsfw: boolean,
|
|
contentIsFree: boolean,
|
|
fee: {
|
|
amount: string,
|
|
currency: string,
|
|
},
|
|
name: ?string,
|
|
nameError: ?string,
|
|
winningBidForClaimUri: number,
|
|
myClaimForUri: ?StreamClaim,
|
|
licenseType: string,
|
|
otherLicenseDescription: ?string,
|
|
licenseUrl: ?string,
|
|
useLBRYUploader: ?boolean,
|
|
publishing: boolean,
|
|
publishSuccess: boolean,
|
|
publishError?: boolean,
|
|
balance: number,
|
|
isStillEditing: boolean,
|
|
clearPublish: () => void,
|
|
resolveUri: (string) => void,
|
|
resetThumbnailStatus: () => void,
|
|
// Add back type
|
|
updatePublishForm: (any) => void,
|
|
checkAvailability: (string) => void,
|
|
ytSignupPending: boolean,
|
|
modal: { id: string, modalProps: {} },
|
|
enablePublishPreview: boolean,
|
|
activeChannelClaim: ?ChannelClaim,
|
|
incognito: boolean,
|
|
user: ?User,
|
|
permanentUrl: ?string,
|
|
remoteUrl: ?string,
|
|
isClaimingInitialRewards: boolean,
|
|
claimInitialRewards: () => void,
|
|
hasClaimedInitialRewards: boolean,
|
|
};
|
|
|
|
function UploadForm(props: Props) {
|
|
// Detect upload type from query in URL
|
|
const {
|
|
thumbnail,
|
|
thumbnailError,
|
|
name,
|
|
editingURI,
|
|
myClaimForUri,
|
|
resolveUri,
|
|
title,
|
|
bid,
|
|
bidError,
|
|
description,
|
|
uploadThumbnailStatus,
|
|
resetThumbnailStatus,
|
|
updatePublishForm,
|
|
filePath,
|
|
fileText,
|
|
publishing,
|
|
publishSuccess,
|
|
publishError,
|
|
clearPublish,
|
|
isStillEditing,
|
|
tags,
|
|
publish,
|
|
disabled = false,
|
|
checkAvailability,
|
|
ytSignupPending,
|
|
modal,
|
|
enablePublishPreview,
|
|
activeChannelClaim,
|
|
incognito,
|
|
user,
|
|
permanentUrl,
|
|
remoteUrl,
|
|
isClaimingInitialRewards,
|
|
claimInitialRewards,
|
|
hasClaimedInitialRewards,
|
|
} = props;
|
|
|
|
const inEditMode = Boolean(editingURI);
|
|
const { replace, location } = useHistory();
|
|
const urlParams = new URLSearchParams(location.search);
|
|
const TYPE_PARAM = 'type';
|
|
const uploadType = urlParams.get(TYPE_PARAM);
|
|
const _uploadType = uploadType && uploadType.toLowerCase();
|
|
|
|
const enableLivestream = ENABLE_NO_SOURCE_CLAIMS && user && !user.odysee_live_disabled;
|
|
|
|
// $FlowFixMe
|
|
const AVAILABLE_MODES = Object.values(PUBLISH_MODES).filter((mode) => {
|
|
// $FlowFixMe
|
|
if (inEditMode) {
|
|
return mode === PUBLISH_MODES.FILE;
|
|
} else if (_uploadType) {
|
|
return mode === _uploadType && (mode !== PUBLISH_MODES.LIVESTREAM || enableLivestream);
|
|
}
|
|
});
|
|
|
|
const MODE_TO_I18N_STR = {
|
|
[PUBLISH_MODES.FILE]: SIMPLE_SITE ? 'Video/Audio' : 'File',
|
|
};
|
|
|
|
const formTitle = !editingURI ? __('Upload a File') : __('Edit Upload');
|
|
|
|
const mode = PUBLISH_MODES.FILE;
|
|
|
|
// Used to check if the url name has changed:
|
|
// A new file needs to be provided
|
|
const [prevName, setPrevName] = React.useState(false);
|
|
// Used to check if the file has been modified by user
|
|
const [fileEdited, setFileEdited] = React.useState(false);
|
|
const [prevFileText, setPrevFileText] = React.useState('');
|
|
|
|
const [waitForFile, setWaitForFile] = useState(false);
|
|
const [overMaxBitrate, setOverMaxBitrate] = useState(false);
|
|
|
|
const TAGS_LIMIT = 5;
|
|
const fileFormDisabled = mode === PUBLISH_MODES.FILE && !filePath && !remoteUrl;
|
|
const emptyPostError = mode === PUBLISH_MODES.POST && (!fileText || fileText.trim() === '');
|
|
const formDisabled = (fileFormDisabled && !editingURI) || emptyPostError || publishing;
|
|
const isInProgress = filePath || editingURI || name || title;
|
|
const activeChannelName = activeChannelClaim && activeChannelClaim.name;
|
|
// Editing content info
|
|
const fileMimeType =
|
|
myClaimForUri && myClaimForUri.value && myClaimForUri.value.source
|
|
? myClaimForUri.value.source.media_type
|
|
: undefined;
|
|
const claimChannelId =
|
|
(myClaimForUri && myClaimForUri.signing_channel && myClaimForUri.signing_channel.claim_id) ||
|
|
(activeChannelClaim && activeChannelClaim.claim_id);
|
|
|
|
const nameEdited = isStillEditing && name !== prevName;
|
|
const thumbnailUploaded = uploadThumbnailStatus === THUMBNAIL_STATUSES.COMPLETE && thumbnail;
|
|
|
|
const waitingForFile = waitForFile && !remoteUrl && !filePath;
|
|
// If they are editing, they don't need a new file chosen
|
|
const formValidLessFile =
|
|
name &&
|
|
isNameValid(name) &&
|
|
title &&
|
|
!overMaxBitrate &&
|
|
bid &&
|
|
thumbnail &&
|
|
!bidError &&
|
|
!emptyPostError &&
|
|
!(thumbnailError && !thumbnailUploaded) &&
|
|
!(uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS);
|
|
|
|
const isOverwritingExistingClaim = !editingURI && myClaimForUri;
|
|
|
|
const formValid = isOverwritingExistingClaim
|
|
? false
|
|
: editingURI && !filePath // if we're editing we don't need a file
|
|
? isStillEditing && formValidLessFile && !waitingForFile
|
|
: formValidLessFile;
|
|
|
|
const [previewing, setPreviewing] = React.useState(false);
|
|
|
|
const isClear = !filePath && !title && !name && !description && !thumbnail;
|
|
|
|
useEffect(() => {
|
|
if (!hasClaimedInitialRewards) {
|
|
claimInitialRewards();
|
|
}
|
|
}, [hasClaimedInitialRewards, claimInitialRewards]);
|
|
|
|
useEffect(() => {
|
|
if (!modal) {
|
|
const timer = setTimeout(() => {
|
|
setPreviewing(false);
|
|
}, 250);
|
|
|
|
return () => clearTimeout(timer);
|
|
}
|
|
}, [modal]);
|
|
|
|
useEffect(() => {
|
|
if (publishError) {
|
|
setPreviewing(false);
|
|
updatePublishForm({ publishError: undefined });
|
|
}
|
|
}, [publishError]);
|
|
|
|
let submitLabel;
|
|
|
|
if (isClaimingInitialRewards) {
|
|
submitLabel = __('Claiming credits...');
|
|
} else if (publishing) {
|
|
if (isStillEditing || inEditMode) {
|
|
submitLabel = __('Saving...');
|
|
} else {
|
|
submitLabel = __('Creating...');
|
|
}
|
|
} else if (previewing) {
|
|
submitLabel = <Spinner type="small" />;
|
|
} else {
|
|
if (isStillEditing || inEditMode) {
|
|
submitLabel = __('Save');
|
|
} else {
|
|
submitLabel = __('Create');
|
|
}
|
|
}
|
|
|
|
// if you enter the page and it is stuck in publishing, "stop it."
|
|
useEffect(() => {
|
|
if (publishing || publishSuccess) {
|
|
clearPublish();
|
|
}
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [clearPublish]);
|
|
|
|
useEffect(() => {
|
|
if (!thumbnail) {
|
|
resetThumbnailStatus();
|
|
}
|
|
}, [thumbnail, resetThumbnailStatus]);
|
|
|
|
// Save previous name of the editing claim
|
|
useEffect(() => {
|
|
if (isStillEditing && (!prevName || !prevName.trim() === '')) {
|
|
if (name !== prevName) {
|
|
setPrevName(name);
|
|
}
|
|
}
|
|
}, [name, prevName, setPrevName, isStillEditing]);
|
|
|
|
// Check for content changes on the text editor
|
|
useEffect(() => {
|
|
if (!fileEdited && fileText !== prevFileText && fileText !== '') {
|
|
setFileEdited(true);
|
|
} else if (fileEdited && fileText === prevFileText) {
|
|
setFileEdited(false);
|
|
}
|
|
}, [fileText, prevFileText, fileEdited]);
|
|
|
|
// Every time the channel or name changes, resolve the uris to find winning bid amounts
|
|
useEffect(() => {
|
|
// We are only going to store the full uri, but we need to resolve the uri with and without the channel name
|
|
let uri;
|
|
try {
|
|
uri = name && buildURI({ streamName: name, activeChannelName });
|
|
} catch (e) {}
|
|
|
|
if (activeChannelName && name) {
|
|
// resolve without the channel name so we know the winning bid for it
|
|
try {
|
|
const uriLessChannel = buildURI({ streamName: name });
|
|
resolveUri(uriLessChannel);
|
|
} catch (e) {}
|
|
}
|
|
|
|
const isValid = uri && isURIValid(uri);
|
|
if (uri && isValid && checkAvailability && name) {
|
|
resolveUri(uri);
|
|
checkAvailability(name);
|
|
updatePublishForm({ uri });
|
|
}
|
|
}, [name, activeChannelName, resolveUri, updatePublishForm, checkAvailability]);
|
|
|
|
// because publish editingUri is channel_short/claim_long and we don't have that, resolve it.
|
|
useEffect(() => {
|
|
if (editingURI) {
|
|
resolveUri(editingURI);
|
|
}
|
|
}, [editingURI, resolveUri]);
|
|
|
|
// set isMarkdownPost in publish form if so, also update isLivestreamPublish
|
|
useEffect(() => {
|
|
updatePublishForm({
|
|
isMarkdownPost: false,
|
|
isLivestreamPublish: mode === PUBLISH_MODES.LIVESTREAM,
|
|
});
|
|
}, [mode, updatePublishForm]);
|
|
|
|
useEffect(() => {
|
|
if (incognito) {
|
|
updatePublishForm({ channel: undefined });
|
|
} else if (activeChannelName) {
|
|
updatePublishForm({ channel: activeChannelName });
|
|
}
|
|
}, [activeChannelName, incognito, updatePublishForm]);
|
|
|
|
// if we have a type urlparam, update it? necessary?
|
|
useEffect(() => {
|
|
if (!_uploadType) return;
|
|
const newParams = new URLSearchParams();
|
|
newParams.set(TYPE_PARAM, mode.toLowerCase());
|
|
replace({ search: newParams.toString() });
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [mode, _uploadType]);
|
|
|
|
// @if TARGET='web'
|
|
function createWebFile() {
|
|
if (fileText) {
|
|
const fileName = name || title;
|
|
if (fileName) {
|
|
return new File([fileText], `${fileName}.md`, { type: 'text/markdown' });
|
|
}
|
|
}
|
|
}
|
|
// @endif
|
|
|
|
async function handlePublish() {
|
|
let outputFile = filePath;
|
|
let runPublish = false;
|
|
|
|
// Publish post:
|
|
// If here is no file selected yet on desktop, show file dialog and let the
|
|
// user choose a file path. On web a new File is created
|
|
if (mode === PUBLISH_MODES.POST && !emptyPostError) {
|
|
// If user modified content on the text editor or editing name has changed:
|
|
// Save changes and update file path
|
|
if (fileEdited || nameEdited) {
|
|
outputFile = createWebFile();
|
|
|
|
// New content stored locally and is not empty
|
|
if (outputFile) {
|
|
updatePublishForm({ filePath: outputFile });
|
|
runPublish = true;
|
|
}
|
|
} else {
|
|
// Only metadata has changed.
|
|
runPublish = true;
|
|
}
|
|
}
|
|
// Publish file
|
|
if (mode === PUBLISH_MODES.FILE) {
|
|
runPublish = true;
|
|
}
|
|
|
|
if (runPublish) {
|
|
if (enablePublishPreview) {
|
|
setPreviewing(true);
|
|
publish(outputFile, true);
|
|
} else {
|
|
publish(outputFile, false);
|
|
}
|
|
}
|
|
}
|
|
|
|
// When accessing to publishing, make sure to reset file input attributes
|
|
// since we can't restore from previous user selection (like we do
|
|
// with other properties such as name, title, etc.) for security reasons.
|
|
useEffect(() => {
|
|
if (mode === PUBLISH_MODES.FILE) {
|
|
updatePublishForm({ filePath: '', fileDur: 0, fileSize: 0 });
|
|
}
|
|
}, [mode, updatePublishForm]);
|
|
|
|
// FIle Source Selector State.
|
|
const [fileSource, setFileSource] = useState();
|
|
const changeFileSource = (state) => setFileSource(state);
|
|
|
|
const [showSchedulingOptions, setShowSchedulingOptions] = useState(false);
|
|
useEffect(() => {
|
|
setShowSchedulingOptions(fileSource === SOURCE_NONE);
|
|
}, [fileSource]);
|
|
|
|
if (publishing) {
|
|
return (
|
|
<div className="main--empty">
|
|
<h1 className="section__subtitle">{__('Publishing...')}</h1>
|
|
<Spinner delayed />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const isFormIncomplete =
|
|
isClaimingInitialRewards ||
|
|
formDisabled ||
|
|
!formValid ||
|
|
uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS ||
|
|
ytSignupPending ||
|
|
previewing;
|
|
|
|
// Editing claim uri
|
|
return (
|
|
<div className="card-stack">
|
|
<h1 className="page__title">
|
|
<Icon icon={ICONS.PUBLISH} />
|
|
<label>
|
|
{formTitle}
|
|
{!isClear && <Button onClick={() => clearPublish()} icon={ICONS.REFRESH} button="primary" label="Clear" />}
|
|
</label>
|
|
</h1>
|
|
|
|
<PublishFile
|
|
inEditMode={inEditMode}
|
|
fileSource={fileSource}
|
|
changeFileSource={changeFileSource}
|
|
uri={permanentUrl}
|
|
mode={mode}
|
|
fileMimeType={fileMimeType}
|
|
disabled={disabled || publishing}
|
|
inProgress={isInProgress}
|
|
setPrevFileText={setPrevFileText}
|
|
setWaitForFile={setWaitForFile}
|
|
setOverMaxBitrate={setOverMaxBitrate}
|
|
channelId={claimChannelId}
|
|
channelName={activeChannelName}
|
|
header={
|
|
<>
|
|
{AVAILABLE_MODES.map((modeName) => (
|
|
<Button
|
|
key={String(modeName)}
|
|
icon={modeName}
|
|
iconSize={18}
|
|
label={__(MODE_TO_I18N_STR[String(modeName)] || '---')}
|
|
button="alt"
|
|
onClick={() => {
|
|
// $FlowFixMe
|
|
// setMode(modeName);
|
|
}}
|
|
className={classnames('button-toggle', { 'button-toggle--active': mode === modeName })}
|
|
/>
|
|
))}
|
|
</>
|
|
}
|
|
/>
|
|
|
|
{mode !== PUBLISH_MODES.POST && <PublishDescription disabled={formDisabled} />}
|
|
|
|
{!publishing && (
|
|
<div className={classnames({ 'card--disabled': formDisabled })}>
|
|
{showSchedulingOptions && <Card body={<PublishStreamReleaseDate />} />}
|
|
|
|
<Card actions={<SelectThumbnail />} />
|
|
|
|
<h2 className="card__title" style={{ marginTop: 'var(--spacing-l)' }}>
|
|
{__('Tags')}
|
|
</h2>
|
|
<TagsSelect
|
|
suggestMature={!SIMPLE_SITE}
|
|
disableAutoFocus
|
|
hideHeader
|
|
label={__('Selected Tags')}
|
|
empty={__('No tags added')}
|
|
limitSelect={TAGS_LIMIT}
|
|
help={__(
|
|
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If your content is best suited for mature audiences, ensure it is tagged 'mature'."
|
|
)}
|
|
placeholder={__('gaming, crypto')}
|
|
onSelect={(newTags) => {
|
|
const validatedTags = [];
|
|
newTags.forEach((newTag) => {
|
|
if (!tags.some((tag) => tag.name === newTag.name)) {
|
|
validatedTags.push(newTag);
|
|
}
|
|
});
|
|
updatePublishForm({ tags: [...tags, ...validatedTags] });
|
|
}}
|
|
onRemove={(clickedTag) => {
|
|
const newTags = tags.slice().filter((tag) => tag.name !== clickedTag.name);
|
|
updatePublishForm({ tags: newTags });
|
|
}}
|
|
tagsChosen={tags}
|
|
/>
|
|
|
|
<PublishAdditionalOptions disabled={formDisabled} showSchedulingOptions={showSchedulingOptions} />
|
|
</div>
|
|
)}
|
|
<section>
|
|
<div className="section__actions">
|
|
<Button button="primary" onClick={handlePublish} label={submitLabel} disabled={isFormIncomplete} />
|
|
<ChannelSelect disabled={isFormIncomplete} autoSet channelToSet={claimChannelId} isPublishMenu />
|
|
</div>
|
|
<p className="help">
|
|
{!formDisabled && !formValid ? (
|
|
<PublishFormErrors title={title} mode={mode} waitForFile={waitingForFile} overMaxBitrate={overMaxBitrate} />
|
|
) : (
|
|
<I18nMessage
|
|
tokens={{
|
|
odysee_terms_of_service: (
|
|
<Button
|
|
button="link"
|
|
href="https://odysee.com/$/tos"
|
|
label={__('%site_name% Terms of Service', { site_name: SITE_NAME })}
|
|
/>
|
|
),
|
|
odysee_community_guidelines: (
|
|
<Button
|
|
button="link"
|
|
href="https://odysee.com/@OdyseeHelp:b/Community-Guidelines:c"
|
|
label={__('community guidelines', { site_name: SITE_NAME })}
|
|
/>
|
|
),
|
|
}}
|
|
>
|
|
By continuing, you accept the %odysee_terms_of_service% and %odysee_community_guidelines%.
|
|
</I18nMessage>
|
|
)}
|
|
</p>
|
|
</section>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default UploadForm;
|