From af90085b263911306f5caca8f8db6267e04a3796 Mon Sep 17 00:00:00 2001 From: DispatchCommit Date: Fri, 5 Mar 2021 14:14:23 -0800 Subject: [PATCH] bookmarking changes with this commit --- ui/component/publishForm/index.js | 16 ++++++---- ui/component/publishForm/view.jsx | 53 ++++++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/ui/component/publishForm/index.js b/ui/component/publishForm/index.js index 4f6315a66..2445b7558 100644 --- a/ui/component/publishForm/index.js +++ b/ui/component/publishForm/index.js @@ -17,9 +17,10 @@ import { doPublishDesktop } from 'redux/actions/publish'; import { selectUnclaimedRewardValue } from 'redux/selectors/rewards'; import { selectModal, selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app'; import { makeSelectClientSetting } from 'redux/selectors/settings'; -import PublishPage from './view'; +import PublishForm from './view'; +import { selectUser } from 'redux/selectors/user'; -const select = state => ({ +const select = (state) => ({ ...selectPublishFormValues(state), // The winning claim for a short lbry uri amountNeededForTakeover: selectTakeOverAmount(state), @@ -34,16 +35,17 @@ const select = state => ({ enablePublishPreview: makeSelectClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW)(state), activeChannelClaim: selectActiveChannelClaim(state), incognito: selectIncognito(state), + user: selectUser(state), }); -const perform = dispatch => ({ - updatePublishForm: value => dispatch(doUpdatePublishForm(value)), +const perform = (dispatch) => ({ + updatePublishForm: (value) => dispatch(doUpdatePublishForm(value)), clearPublish: () => dispatch(doClearPublish()), - resolveUri: uri => dispatch(doResolveUri(uri)), + resolveUri: (uri) => dispatch(doResolveUri(uri)), publish: (filePath, preview) => dispatch(doPublishDesktop(filePath, preview)), prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)), resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()), - checkAvailability: name => dispatch(doCheckPublishNameAvailability(name)), + checkAvailability: (name) => dispatch(doCheckPublishNameAvailability(name)), }); -export default connect(select, perform)(PublishPage); +export default connect(select, perform)(PublishForm); diff --git a/ui/component/publishForm/view.jsx b/ui/component/publishForm/view.jsx index 9e199a326..96268a8c4 100644 --- a/ui/component/publishForm/view.jsx +++ b/ui/component/publishForm/view.jsx @@ -25,6 +25,7 @@ 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 { FormField } from 'component/common/form'; // @if TARGET='app' import fs from 'fs'; @@ -72,14 +73,14 @@ type Props = { balance: number, isStillEditing: boolean, clearPublish: () => void, - resolveUri: string => void, + resolveUri: (string) => void, scrollToTop: () => void, prepareEdit: (claim: any, uri: string) => void, resetThumbnailStatus: () => void, amountNeededForTakeover: ?number, // Add back type - updatePublishForm: any => void, - checkAvailability: string => void, + updatePublishForm: (any) => void, + checkAvailability: (string) => void, ytSignupPending: boolean, modal: { id: string, modalProps: {} }, enablePublishPreview: boolean, @@ -124,8 +125,12 @@ function PublishForm(props: Props) { enablePublishPreview, activeChannelClaim, incognito, + user, + isLivestreamPublish, } = props; + const isLivestreamCreator = (user && user.experimental_ui) || false; + const TAGS_LIMIT = 5; const fileFormDisabled = mode === PUBLISH_MODES.FILE && !filePath; const emptyPostError = mode === PUBLISH_MODES.POST && (!fileText || fileText.trim() === ''); @@ -332,6 +337,38 @@ function PublishForm(props: Props) {
+ {/* Some LiveStream Publishing Hack Sean made */} + {isLivestreamCreator && ( +
+

Hello brave beta tester,

+

+ Check this box if you have entered video information for your livestream. It doesn't matter what file you + choose for now, just make the sure the title, description, and tags are correct. Everything else is setup! +

+

+ When you edit this file, there will be another checkbox to turn this back into a regular video so it can be + listed on your channel's page. +

+ + updatePublishForm({ isLivestreamPublish: e.target.checked })} + /> + {isStillEditing && ( + updatePublishForm({ isLivestreamPublish: !e.target.checked })} + /> + )} +
+ )} + { + onSelect={(newTags) => { const validatedTags = []; - newTags.forEach(newTag => { - if (!tags.some(tag => tag.name === newTag.name)) { + 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); + onRemove={(clickedTag) => { + const newTags = tags.slice().filter((tag) => tag.name !== clickedTag.name); updatePublishForm({ tags: newTags }); }} tagsChosen={tags}