From 2cda3d0a62aa058a6d4fdd5d45a2e385cf8d1e76 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Sat, 7 Aug 2021 20:50:24 +0800 Subject: [PATCH] [Content] grab "Skip publish preview" --- static/app-strings.json | 1 + ui/component/publishSettings/index.js | 15 ------------- ui/component/publishSettings/view.jsx | 31 --------------------------- ui/component/settingContent/index.js | 1 + ui/component/settingContent/view.jsx | 14 ++++++++++++ ui/page/settingsAdvanced/view.jsx | 3 --- 6 files changed, 16 insertions(+), 49 deletions(-) delete mode 100644 ui/component/publishSettings/index.js delete mode 100644 ui/component/publishSettings/view.jsx diff --git a/static/app-strings.json b/static/app-strings.json index b983ff095..3c0ea2ac6 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1419,6 +1419,7 @@ "Transcode": "Transcode", "Estimated transaction fee:": "Estimated transaction fee:", "Est. transaction fee:": "Est. transaction fee:", + "Publish confirmation": "Publish confirmation", "Skip preview and confirmation": "Skip preview and confirmation", "Upload settings": "Upload settings", "Currently Uploading": "Currently Uploading", diff --git a/ui/component/publishSettings/index.js b/ui/component/publishSettings/index.js deleted file mode 100644 index 7233f4994..000000000 --- a/ui/component/publishSettings/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import { SETTINGS } from 'lbry-redux'; -import { connect } from 'react-redux'; -import { makeSelectClientSetting } from 'redux/selectors/settings'; -import { doSetClientSetting } from 'redux/actions/settings'; -import PublishSettings from './view'; - -const select = state => ({ - enablePublishPreview: makeSelectClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW)(state), -}); - -const perform = dispatch => ({ - setEnablePublishPreview: value => dispatch(doSetClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW, value)), -}); - -export default connect(select, perform)(PublishSettings); diff --git a/ui/component/publishSettings/view.jsx b/ui/component/publishSettings/view.jsx deleted file mode 100644 index d59d4e6ea..000000000 --- a/ui/component/publishSettings/view.jsx +++ /dev/null @@ -1,31 +0,0 @@ -// @flow -import React from 'react'; -import { FormField } from 'component/common/form'; -import { withRouter } from 'react-router'; - -type Props = { - enablePublishPreview: boolean, - setEnablePublishPreview: boolean => void, -}; - -function PublishSettings(props: Props) { - const { enablePublishPreview, setEnablePublishPreview } = props; - - function handleChange() { - setEnablePublishPreview(!enablePublishPreview); - } - - return ( -
- -
- ); -} - -export default withRouter(PublishSettings); diff --git a/ui/component/settingContent/index.js b/ui/component/settingContent/index.js index 01723b14e..766f5efff 100644 --- a/ui/component/settingContent/index.js +++ b/ui/component/settingContent/index.js @@ -16,6 +16,7 @@ const select = (state) => ({ myChannelUrls: selectMyChannelUrls(state), instantPurchaseEnabled: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_ENABLED)(state), instantPurchaseMax: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_MAX)(state), + enablePublishPreview: makeSelectClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW)(state), }); const perform = (dispatch) => ({ diff --git a/ui/component/settingContent/view.jsx b/ui/component/settingContent/view.jsx index 67253b106..d577a74ab 100644 --- a/ui/component/settingContent/view.jsx +++ b/ui/component/settingContent/view.jsx @@ -18,6 +18,7 @@ type Price = { }; type Props = { + // --- select --- isAuthenticated: boolean, floatingPlayer: boolean, autoplay: boolean, @@ -26,6 +27,8 @@ type Props = { myChannelUrls: ?Array, instantPurchaseEnabled: boolean, instantPurchaseMax: Price, + enablePublishPreview: boolean, + // --- perform --- setClientSetting: (string, boolean | string | number) => void, clearPlayingUri: () => void, openModal: (string) => void, @@ -41,6 +44,7 @@ export default function SettingContent(props: Props) { myChannelUrls, instantPurchaseEnabled, instantPurchaseMax, + enablePublishPreview, setClientSetting, clearPlayingUri, openModal, @@ -149,6 +153,16 @@ export default function SettingContent(props: Props) { )} + + setClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW, !enablePublishPreview)} + /> + + {/* @if TARGET='app' */} diff --git a/ui/page/settingsAdvanced/view.jsx b/ui/page/settingsAdvanced/view.jsx index 3f69a9eef..c53481f8b 100644 --- a/ui/page/settingsAdvanced/view.jsx +++ b/ui/page/settingsAdvanced/view.jsx @@ -12,7 +12,6 @@ import { SETTINGS } from 'lbry-redux'; import Card from 'component/common/card'; import { getPasswordFromCookie } from 'util/saved-passwords'; import Spinner from 'component/spinner'; -import PublishSettings from 'component/publishSettings'; type Price = { currency: string, @@ -360,8 +359,6 @@ class SettingsAdvancedPage extends React.PureComponent { {/* @if TARGET='app' */} } /> {/* @endif */} - - } /> )}