diff --git a/ui/component/publishFile/view.jsx b/ui/component/publishFile/view.jsx index e0a1280ce..1eed81911 100644 --- a/ui/component/publishFile/view.jsx +++ b/ui/component/publishFile/view.jsx @@ -15,6 +15,7 @@ import usePersistedState from 'effects/use-persisted-state'; import * as PUBLISH_MODES from 'constants/publish_types'; import PublishName from 'component/publishName'; import CopyableText from 'component/copyableText'; +import Empty from 'component/common/empty'; import moment from 'moment'; import classnames from 'classnames'; import ReactPaginate from 'react-paginate'; @@ -45,7 +46,6 @@ type Props = { header: Node, livestreamData: LivestreamReplayData, isLivestreamClaim: boolean, - remoteUrl?: string, checkLivestreams: () => void, isCheckingLivestreams: boolean, }; @@ -76,7 +76,6 @@ function PublishFile(props: Props) { livestreamData, isLivestreamClaim, subtitle, - remoteUrl, checkLivestreams, isCheckingLivestreams, } = props; @@ -109,11 +108,11 @@ function PublishFile(props: Props) { const fileSelectorModes = [ { label: __('Choose Replay'), actionName: SOURCE_SELECT, icon: ICONS.MENU }, { label: __('Upload'), actionName: SOURCE_UPLOAD, icon: ICONS.PUBLISH }, - { label: __('None'), actionName: SOURCE_NONE, icon: ICONS.REMOVE }, + { label: __('None'), actionName: SOURCE_NONE }, ]; const hasLivestreamData = livestreamData && Boolean(livestreamData.length); - const showSourceSelector = isLivestreamClaim && hasLivestreamData; + const showSourceSelector = isLivestreamClaim; const [fileSelectSource, setFileSelectSource] = useState( IS_WEB && showSourceSelector ? SOURCE_SELECT : SOURCE_UPLOAD @@ -227,13 +226,6 @@ function PublishFile(props: Props) { } } - function getSourceMessage() { - if (remoteUrl || filePath) { - return __('Replay selected for update'); - } else { - return __('No replay selected'); - } - } function getUploadMessage() { // @if TARGET='web' if (oversized) { @@ -470,14 +462,14 @@ function PublishFile(props: Props) { <> {showSourceSelector && ( -
+
-
+
{fileSelectorModes.map((fmode) => (
-
{getSourceMessage()}
-
)} @@ -518,58 +511,54 @@ function PublishFile(props: Props) { {getUploadMessage()} )} - {fileSelectSource === SOURCE_SELECT && showFileUpload && ( + {fileSelectSource === SOURCE_SELECT && showFileUpload && hasLivestreamData && ( <>
- {livestreamData && - livestreamData - .slice((currentPage - 1) * PAGE_SIZE, currentPage * PAGE_SIZE) - .map((item, i) => ( - ( + setSelectedFileIndex((currentPage - 1) * PAGE_SIZE + i)} + key={item.id} + className={classnames('livestream__data-row', { + 'livestream__data-row--selected': selectedFileIndex === (currentPage - 1) * PAGE_SIZE + i, + })} + > + - - - - - ))} + className="livestream__data-row-radio" + /> + + + + + + ))}
+ setSelectedFileIndex((currentPage - 1) * PAGE_SIZE + i)} - key={item.id} - className={classnames('livestream__data-row', { - 'livestream__data-row--selected': - selectedFileIndex === (currentPage - 1) * PAGE_SIZE + i, - })} - > - - setSelectedFileIndex((currentPage - 1) * PAGE_SIZE + i)} - className="livestream__data-row-radio" - /> - -
- {item.data.thumbnails.slice(0, 3).map((thumb) => ( - - ))} -
-
- {`${Math.floor(item.data.fileDuration / 60)} ${ - Math.floor(item.data.fileDuration / 60) > 1 ? __('minutes') : __('minute') - }`} -
- {`${moment(item.data.uploadedAt).from(moment())}`} -
-
- -
+
+ {item.data.thumbnails.slice(0, 3).map((thumb) => ( + + ))} +
+
+ {`${Math.floor(item.data.fileDuration / 60)} ${ + Math.floor(item.data.fileDuration / 60) > 1 ? __('minutes') : __('minute') + }`} +
+ {`${moment(item.data.uploadedAt).from(moment())}`} +
+
+ +
@@ -596,6 +585,16 @@ function PublishFile(props: Props) { )} + {fileSelectSource === SOURCE_SELECT && showFileUpload && !hasLivestreamData && !isCheckingLivestreams && ( +
+ +
+ )} + {fileSelectSource === SOURCE_SELECT && showFileUpload && !hasLivestreamData && isCheckingLivestreams && ( +
+ +
+ )} {/* @endif */} {/* @if TARGET='app' */} diff --git a/ui/scss/component/section.scss b/ui/scss/component/section.scss index 2fce62c60..5596bf9be 100644 --- a/ui/scss/component/section.scss +++ b/ui/scss/component/section.scss @@ -172,6 +172,10 @@ } } +.section__actions--align-bottom { + align-items: flex-end; +} + .section__actions--no-margin { @extend .section__actions; margin-top: 0;