From b4851e6045ecfce3fe7041592b019dda28fe2e0f Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 19 Jun 2020 16:18:12 -0400 Subject: [PATCH] bring in email preferences page from lbry.com --- ui/component/router/view.jsx | 2 + ui/constants/pages.js | 1 + ui/page/settings/index.js | 2 - ui/page/settings/view.jsx | 75 +++--- ui/page/settingsNotifications/index.js | 16 ++ ui/page/settingsNotifications/view.jsx | 181 +++++++++++++++ yarn.lock | 306 ++++++------------------- 7 files changed, 304 insertions(+), 279 deletions(-) create mode 100644 ui/page/settingsNotifications/index.js create mode 100644 ui/page/settingsNotifications/view.jsx diff --git a/ui/component/router/view.jsx b/ui/component/router/view.jsx index 0b490c7c2..722290d7f 100644 --- a/ui/component/router/view.jsx +++ b/ui/component/router/view.jsx @@ -3,6 +3,7 @@ import * as PAGES from 'constants/pages'; import React, { useEffect } from 'react'; import { Route, Redirect, Switch, withRouter } from 'react-router-dom'; import SettingsPage from 'page/settings'; +import SettingsNotificationsPage from 'page/settingsNotifications'; import HelpPage from 'page/help'; // @if TARGET='app' import BackupPage from 'page/backup'; @@ -182,6 +183,7 @@ function AppRouter(props: Props) { + diff --git a/ui/constants/pages.js b/ui/constants/pages.js index 9f53a7b43..3de724663 100644 --- a/ui/constants/pages.js +++ b/ui/constants/pages.js @@ -17,6 +17,7 @@ exports.REWARDS = 'rewards'; exports.REWARDS_VERIFY = 'rewards/verify'; exports.SEND = 'send'; exports.SETTINGS = 'settings'; +exports.SETTINGS_NOTIFICATIONS = 'settings/notifications'; exports.SHOW = 'show'; exports.ACCOUNT = 'account'; exports.SEARCH = 'search'; diff --git a/ui/page/settings/index.js b/ui/page/settings/index.js index d964749d4..d13ea8cef 100644 --- a/ui/page/settings/index.js +++ b/ui/page/settings/index.js @@ -20,7 +20,6 @@ import { makeSelectClientSetting, selectDaemonSettings, selectFfmpegStatus, - selectosNotificationsEnabled, selectFindingFFmpeg, } from 'redux/selectors/settings'; import { doWalletStatus, selectWalletIsEncrypted, selectBlockedChannelsCount, SETTINGS } from 'lbry-redux'; @@ -39,7 +38,6 @@ const select = state => ({ automaticDarkModeEnabled: makeSelectClientSetting(SETTINGS.AUTOMATIC_DARK_MODE_ENABLED)(state), autoplay: makeSelectClientSetting(SETTINGS.AUTOPLAY)(state), walletEncrypted: selectWalletIsEncrypted(state), - osNotificationsEnabled: selectosNotificationsEnabled(state), autoDownload: makeSelectClientSetting(SETTINGS.AUTO_DOWNLOAD)(state), userBlockedChannelsCount: selectBlockedChannelsCount(state), hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state), diff --git a/ui/page/settings/view.jsx b/ui/page/settings/view.jsx index f65276604..24c25679a 100644 --- a/ui/page/settings/view.jsx +++ b/ui/page/settings/view.jsx @@ -4,6 +4,7 @@ import * as PAGES from 'constants/pages'; import * as MODALS from 'constants/modal_types'; +import * as ICONS from 'constants/icons'; import * as React from 'react'; import { FormField, FormFieldPrice } from 'component/common/form'; @@ -74,7 +75,6 @@ type Props = { decryptWallet: () => void, updateWalletStatus: () => void, walletEncrypted: boolean, - osNotificationsEnabled: boolean, userBlockedChannelsCount?: number, hideBalance: boolean, confirmForgetPassword: ({}) => void, @@ -233,7 +233,6 @@ class SettingsPage extends React.PureComponent { automaticDarkModeEnabled, autoplay, walletEncrypted, - osNotificationsEnabled, // autoDownload, setDaemonSetting, setClientSetting, @@ -481,43 +480,47 @@ class SettingsPage extends React.PureComponent { /> {(isAuthenticated || !IS_WEB) && ( - - - {userBlockedChannelsCount === 0 - ? __("You don't have blocked channels.") - : userBlockedChannelsCount === 1 - ? __('You have one blocked channel.') + ' ' - : __('You have %channels% blocked channels.', { channels: userBlockedChannelsCount }) + ' '} - { -