From dcfa5742e1d047ec7600462ccd5859d0d7a941c0 Mon Sep 17 00:00:00 2001 From: miikkatu Date: Tue, 1 May 2018 21:14:49 +0300 Subject: [PATCH 1/5] Price badge improvements --- CHANGELOG.md | 2 ++ src/renderer/scss/_gui.scss | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d8c212bd..e1f81296d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Changed * Add flair to snackbar ([#1313](https://github.com/lbryio/lbry-app/pull/1313)) + * Made font in price badge larger ([#1420](https://github.com/lbryio/lbry-app/pull/1420)) ### Fixed * Black screen on macOS after maximizing LBRY and then closing ([#1235](https://github.com/lbryio/lbry-app/pull/1235)) @@ -26,6 +27,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). * Fix download percentage indicator overlay ([#1271](https://github.com/lbryio/lbry-app/issues/1271)) * Fix alternate row shading for transactions on dark theme ([#1355](https://github.com/lbryio/lbry-app/issues/#1355)) * Fix Description box on Publish (dark theme) ([#1356](https://github.com/lbryio/lbry-app/issues/#1356)) + * Fix price wrapping in price badge ([#1420](https://github.com/lbryio/lbry-app/pull/1420)) * Fix spacing in search suggestions ([#1422])(https://github.com/lbryio/lbry-app/pull/1422)) * Fix text/HTML files don't display correctly in-app anymore ([#1379])(https://github.com/lbryio/lbry-app/issues/1379) diff --git a/src/renderer/scss/_gui.scss b/src/renderer/scss/_gui.scss index 10793ccf7..b89ace9fe 100644 --- a/src/renderer/scss/_gui.scss +++ b/src/renderer/scss/_gui.scss @@ -252,10 +252,11 @@ p { } .credit-amount { - padding: 5px; border-radius: 5px; font-family: 'metropolis-bold'; - font-size: 8px; + font-size: 10px; + padding: 6px 5px 4px 5px; + white-space: nowrap; } .credit-amount--large { From 4191eac13832533321997c241c035307e8579358 Mon Sep 17 00:00:00 2001 From: miikkatu Date: Sat, 5 May 2018 09:46:15 +0300 Subject: [PATCH 2/5] Changes per review --- src/renderer/scss/_gui.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/renderer/scss/_gui.scss b/src/renderer/scss/_gui.scss index b89ace9fe..9904a94f9 100644 --- a/src/renderer/scss/_gui.scss +++ b/src/renderer/scss/_gui.scss @@ -255,8 +255,7 @@ p { border-radius: 5px; font-family: 'metropolis-bold'; font-size: 10px; - padding: 6px 5px 4px 5px; - white-space: nowrap; + padding: 5px; } .credit-amount--large { From 16c09a9ddd8cbf75888c33281ba1b8946091592c Mon Sep 17 00:00:00 2001 From: Daniel Dominguez Date: Sat, 5 May 2018 16:04:47 -0300 Subject: [PATCH 3/5] Move modals types constants to lbry-redux repository. - Remove useless file modal types as is not referenced anymore in this repository. - Changed import statements to use lbry-redux to import modal types constants. --- src/renderer/component/fileActions/view.jsx | 4 +- src/renderer/component/splash/view.jsx | 9 ++-- .../component/subscribeButton/view.jsx | 4 +- .../component/transactionList/view.jsx | 4 +- src/renderer/component/userVerify/index.js | 5 +- src/renderer/component/wunderbar/index.js | 3 +- src/renderer/constants/modal_types.js | 22 -------- src/renderer/modal/modalRouter/view.jsx | 50 +++++++++---------- src/renderer/page/file/view.jsx | 5 +- src/renderer/redux/actions/app.js | 2 +- src/renderer/redux/actions/content.js | 4 +- src/renderer/redux/actions/publish.js | 3 +- src/renderer/redux/actions/rewards.js | 2 +- src/renderer/redux/actions/user.js | 3 +- src/renderer/redux/reducers/app.js | 2 +- 15 files changed, 47 insertions(+), 75 deletions(-) delete mode 100644 src/renderer/constants/modal_types.js diff --git a/src/renderer/component/fileActions/view.jsx b/src/renderer/component/fileActions/view.jsx index 1a0c03300..94995d245 100644 --- a/src/renderer/component/fileActions/view.jsx +++ b/src/renderer/component/fileActions/view.jsx @@ -2,7 +2,7 @@ import React from 'react'; import Button from 'component/button'; import FileDownloadLink from 'component/fileDownloadLink'; -import * as modals from 'constants/modal_types'; +import { MODALS } from 'lbry-redux'; import classnames from 'classnames'; import * as icons from 'constants/icons'; @@ -33,7 +33,7 @@ class FileActions extends React.PureComponent { className="btn--file-actions" icon={icons.TRASH} description={__('Delete')} - onClick={() => openModal({ id: modals.CONFIRM_FILE_REMOVE }, { uri })} + onClick={() => openModal({ id: MODALS.CONFIRM_FILE_REMOVE }, { uri })} /> )} {!claimIsMine && ( diff --git a/src/renderer/component/splash/view.jsx b/src/renderer/component/splash/view.jsx index 1bb81518c..5985503c9 100644 --- a/src/renderer/component/splash/view.jsx +++ b/src/renderer/component/splash/view.jsx @@ -1,10 +1,9 @@ import * as React from 'react'; -import { Lbry } from 'lbry-redux'; +import { Lbry, MODALS } from 'lbry-redux'; import LoadScreen from './internal/load-screen'; import ModalIncompatibleDaemon from 'modal/modalIncompatibleDaemon'; import ModalUpgrade from 'modal/modalUpgrade'; import ModalDownloading from 'modal/modalDownloading'; -import * as modals from 'constants/modal_types'; type Props = { checkDaemonVersion: () => Promise, @@ -115,9 +114,9 @@ export class SplashScreen extends React.PureComponent { in the modals won't work. */} {isRunning && ( - {notificationId === modals.INCOMPATIBLE_DAEMON && } - {notificationId === modals.UPGRADE && } - {notificationId === modals.DOWNLOADING && } + {notificationId === MODALS.INCOMPATIBLE_DAEMON && } + {notificationId === MODALS.UPGRADE && } + {notificationId === MODALS.DOWNLOADING && } )} diff --git a/src/renderer/component/subscribeButton/view.jsx b/src/renderer/component/subscribeButton/view.jsx index fce08876f..1a341447f 100644 --- a/src/renderer/component/subscribeButton/view.jsx +++ b/src/renderer/component/subscribeButton/view.jsx @@ -1,6 +1,6 @@ // @flow import React from 'react'; -import * as modals from 'constants/modal_types'; +import { MODALS } from 'lbry-redux'; import * as icons from 'constants/icons'; import Button from 'component/button'; import type { Subscription } from 'redux/reducers/subscriptions'; @@ -42,7 +42,7 @@ export default (props: Props) => { label={subscriptionLabel} onClick={() => { if (!subscriptions.length) { - doNotify({ id: modals.FIRST_SUBSCRIPTION }); + doNotify({ id: MODALS.FIRST_SUBSCRIPTION }); } subscriptionHandler({ channelName, diff --git a/src/renderer/component/transactionList/view.jsx b/src/renderer/component/transactionList/view.jsx index 8316f1291..c0b84be33 100644 --- a/src/renderer/component/transactionList/view.jsx +++ b/src/renderer/component/transactionList/view.jsx @@ -4,7 +4,7 @@ import { FormField } from 'component/common/form'; import Button from 'component/button'; import FileExporter from 'component/common/file-exporter'; import * as icons from 'constants/icons'; -import * as modals from 'constants/modal_types'; +import { MODALS } from 'lbry-redux'; import TransactionListItem from './internal/transaction-list-item'; export type Transaction = { @@ -65,7 +65,7 @@ class TransactionList extends React.PureComponent { } revokeClaim(txid: string, nout: number) { - this.props.openModal({ id: modals.CONFIRM_CLAIM_REVOKE }, { txid, nout }); + this.props.openModal({ id: MODALS.CONFIRM_CLAIM_REVOKE }, { txid, nout }); } render() { diff --git a/src/renderer/component/userVerify/index.js b/src/renderer/component/userVerify/index.js index 3533affbd..a6ca5a554 100644 --- a/src/renderer/component/userVerify/index.js +++ b/src/renderer/component/userVerify/index.js @@ -8,8 +8,7 @@ import { selectIdentityVerifyErrorMessage, } from 'redux/selectors/user'; import UserVerify from './view'; -import { doNotify } from 'lbry-redux'; -import { PHONE_COLLECTION } from 'constants/modal_types'; +import { doNotify, MODALS } from 'lbry-redux'; const select = (state, props) => { const selectReward = makeSelectRewardByType(); @@ -24,7 +23,7 @@ const select = (state, props) => { const perform = dispatch => ({ navigate: uri => dispatch(doNavigate(uri)), verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)), - verifyPhone: () => dispatch(doNotify({ id: PHONE_COLLECTION })), + verifyPhone: () => dispatch(doNotify({ id: MODALS.PHONE_COLLECTION })), }); export default connect(select, perform)(UserVerify); diff --git a/src/renderer/component/wunderbar/index.js b/src/renderer/component/wunderbar/index.js index 20d6f6b94..0d222a721 100644 --- a/src/renderer/component/wunderbar/index.js +++ b/src/renderer/component/wunderbar/index.js @@ -1,11 +1,10 @@ -import * as MODALS from 'constants/modal_types'; import { connect } from 'react-redux'; -import { normalizeURI } from 'lbry-redux'; import { selectSearchState as selectSearch, selectWunderBarAddress, doUpdateSearchQuery, doNotify, + MODALS, } from 'lbry-redux'; import { doNavigate } from 'redux/actions/navigation'; import Wunderbar from './view'; diff --git a/src/renderer/constants/modal_types.js b/src/renderer/constants/modal_types.js deleted file mode 100644 index 3d3a725a2..000000000 --- a/src/renderer/constants/modal_types.js +++ /dev/null @@ -1,22 +0,0 @@ -export const CONFIRM_FILE_REMOVE = 'confirm_file_remove'; -export const INCOMPATIBLE_DAEMON = 'incompatible_daemon'; -export const FILE_TIMEOUT = 'file_timeout'; -export const DOWNLOADING = 'downloading'; -export const AUTO_UPDATE_DOWNLOADED = 'auto_update_downloaded'; -export const AUTO_UPDATE_CONFIRM = 'auto_update_confirm'; -export const ERROR = 'error'; -export const INSUFFICIENT_CREDITS = 'insufficient_credits'; -export const UPGRADE = 'upgrade'; -export const WELCOME = 'welcome'; -export const EMAIL_COLLECTION = 'email_collection'; -export const PHONE_COLLECTION = 'phone_collection'; -export const FIRST_REWARD = 'first_reward'; -export const AUTHENTICATION_FAILURE = 'auth_failure'; -export const TRANSACTION_FAILED = 'transaction_failed'; -export const REWARD_APPROVAL_REQUIRED = 'reward_approval_required'; -export const AFFIRM_PURCHASE = 'affirm_purchase'; -export const CONFIRM_CLAIM_REVOKE = 'confirm_claim_revoke'; -export const FIRST_SUBSCRIPTION = 'firstSubscription'; -export const SEND_TIP = 'send_tip'; -export const PUBLISH = 'publish'; -export const SEARCH = 'search'; diff --git a/src/renderer/modal/modalRouter/view.jsx b/src/renderer/modal/modalRouter/view.jsx index 0e45ea0de..e425dddf0 100644 --- a/src/renderer/modal/modalRouter/view.jsx +++ b/src/renderer/modal/modalRouter/view.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import { MODALS } from 'lbry-redux'; import ModalError from 'modal/modalError'; import ModalAuthFailure from 'modal/modalAuthFailure'; import ModalDownloading from 'modal/modalDownloading'; @@ -20,7 +21,6 @@ import ModalFirstSubscription from 'modal/modalFirstSubscription'; import ModalSendTip from '../modalSendTip'; import ModalPublish from '../modalPublish'; import ModalSearch from '../modalSearch'; -import * as modals from 'constants/modal_types'; class ModalRouter extends React.PureComponent { constructor(props) { @@ -68,7 +68,7 @@ class ModalRouter extends React.PureComponent { checkShowWelcome(props) { const { isWelcomeAcknowledged, user } = props; if (!isWelcomeAcknowledged && user && !user.is_reward_approved && !user.is_identity_verified) { - return modals.WELCOME; + return MODALS.WELCOME; } } @@ -80,7 +80,7 @@ class ModalRouter extends React.PureComponent { user && !user.has_verified_email ) { - return modals.EMAIL_COLLECTION; + return MODALS.EMAIL_COLLECTION; } } @@ -92,7 +92,7 @@ class ModalRouter extends React.PureComponent { !isCreditIntroAcknowledged && (['send', 'publish'].includes(page) || this.isPaidShowPage(props)) ) { - return modals.INSUFFICIENT_CREDITS; + return MODALS.INSUFFICIENT_CREDITS; } } @@ -113,47 +113,47 @@ class ModalRouter extends React.PureComponent { } switch (notification.id) { - case modals.UPGRADE: + case MODALS.UPGRADE: return ; - case modals.DOWNLOADING: + case MODALS.DOWNLOADING: return ; - case modals.AUTO_UPDATE_DOWNLOADED: + case MODALS.AUTO_UPDATE_DOWNLOADED: return ; - case modals.AUTO_UPDATE_CONFIRM: + case MODALS.AUTO_UPDATE_CONFIRM: return ; - case modals.ERROR: + case MODALS.ERROR: return ; - case modals.FILE_TIMEOUT: + case MODALS.FILE_TIMEOUT: return ; - case modals.INSUFFICIENT_CREDITS: + case MODALS.INSUFFICIENT_CREDITS: return ; - case modals.WELCOME: + case MODALS.WELCOME: return ; - case modals.FIRST_REWARD: + case MODALS.FIRST_REWARD: return ; - case modals.AUTHENTICATION_FAILURE: + case MODALS.AUTHENTICATION_FAILURE: return ; - case modals.TRANSACTION_FAILED: + case MODALS.TRANSACTION_FAILED: return ; - case modals.REWARD_APPROVAL_REQUIRED: + case MODALS.REWARD_APPROVAL_REQUIRED: return ; - case modals.CONFIRM_FILE_REMOVE: + case MODALS.CONFIRM_FILE_REMOVE: return ; - case modals.AFFIRM_PURCHASE: + case MODALS.AFFIRM_PURCHASE: return ; - case modals.CONFIRM_CLAIM_REVOKE: + case MODALS.CONFIRM_CLAIM_REVOKE: return ; - case modals.PHONE_COLLECTION: + case MODALS.PHONE_COLLECTION: return ; - case modals.EMAIL_COLLECTION: + case MODALS.EMAIL_COLLECTION: return ; - case modals.FIRST_SUBSCRIPTION: + case MODALS.FIRST_SUBSCRIPTION: return ; - case modals.SEND_TIP: + case MODALS.SEND_TIP: return ; - case modals.PUBLISH: + case MODALS.PUBLISH: return ; - case modals.SEARCH: + case MODALS.SEARCH: return ; default: return null; diff --git a/src/renderer/page/file/view.jsx b/src/renderer/page/file/view.jsx index 201d03956..5cbbad39b 100644 --- a/src/renderer/page/file/view.jsx +++ b/src/renderer/page/file/view.jsx @@ -1,6 +1,6 @@ // @flow import * as React from 'react'; -import { Lbry, buildURI, normalizeURI } from 'lbry-redux'; +import { Lbry, buildURI, normalizeURI, MODALS } from 'lbry-redux'; import Video from 'component/video'; import Thumbnail from 'component/common/thumbnail'; import FilePrice from 'component/filePrice'; @@ -14,7 +14,6 @@ import Button from 'component/button'; import SubscribeButton from 'component/subscribeButton'; import Page from 'component/page'; import player from 'render-media'; -import * as modals from 'constants/modal_types'; type Props = { claim: { @@ -171,7 +170,7 @@ class FilePage extends React.Component { button="alt" iconRight="Send" label={__('Enjoy this? Send a tip')} - onClick={() => openModal({ id: modals.SEND_TIP }, { uri })} + onClick={() => openModal({ id: MODALS.SEND_TIP }, { uri })} /> diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index 24e742123..3d6167639 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -1,7 +1,6 @@ import { execSync } from 'child_process'; import isDev from 'electron-is-dev'; import path from 'path'; -import * as MODALS from 'constants/modal_types'; import { ipcRenderer, remote } from 'electron'; import { ACTIONS, @@ -10,6 +9,7 @@ import { doFetchFileInfosAndPublishedClaims, doNotify, selectNotification, + MODALS, } from 'lbry-redux'; import Native from 'native'; import { doFetchRewardedContent } from 'redux/actions/content'; diff --git a/src/renderer/redux/actions/content.js b/src/renderer/redux/actions/content.js index cbdbc8496..1ae851565 100644 --- a/src/renderer/redux/actions/content.js +++ b/src/renderer/redux/actions/content.js @@ -1,8 +1,6 @@ -import * as MODALS from 'constants/modal_types'; import * as NOTIFICATION_TYPES from 'constants/notification_types'; import { ipcRenderer } from 'electron'; import Lbryio from 'lbryio'; -import { doNotify } from 'lbry-redux'; import { doAlertError } from 'redux/actions/app'; import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards'; import { doNavigate } from 'redux/actions/navigation'; @@ -27,6 +25,8 @@ import { selectDownloadingByOutpoint, selectTotalDownloadProgress, selectBalance, + MODALS, + doNotify, } from 'lbry-redux'; import { makeSelectClientSetting } from 'redux/selectors/settings'; import setBadge from 'util/setBadge'; diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index 1c1a79923..2981299fc 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -1,6 +1,5 @@ // @flow -import * as MODALS from 'constants/modal_types'; -import { ACTIONS, Lbry, selectMyClaimsWithoutChannels, doNotify } from 'lbry-redux'; +import { ACTIONS, Lbry, selectMyClaimsWithoutChannels, doNotify, MODALS } from 'lbry-redux'; import { selectPendingPublishes } from 'redux/selectors/publish'; import type { UpdatePublishFormData, diff --git a/src/renderer/redux/actions/rewards.js b/src/renderer/redux/actions/rewards.js index 3349a536b..f51b410f2 100644 --- a/src/renderer/redux/actions/rewards.js +++ b/src/renderer/redux/actions/rewards.js @@ -1,5 +1,5 @@ import * as ACTIONS from 'constants/action_types'; -import * as MODALS from 'constants/modal_types'; +import { MODALS } from 'lbry-redux'; import Lbryio from 'lbryio'; import { selectUnclaimedRewardsByType } from 'redux/selectors/rewards'; import { selectUserIsRewardApproved } from 'redux/selectors/user'; diff --git a/src/renderer/redux/actions/user.js b/src/renderer/redux/actions/user.js index 730e0f3b2..8fc5bcb39 100644 --- a/src/renderer/redux/actions/user.js +++ b/src/renderer/redux/actions/user.js @@ -1,7 +1,6 @@ import * as ACTIONS from 'constants/action_types'; -import * as MODALS from 'constants/modal_types'; import Lbryio from 'lbryio'; -import { doNotify } from 'lbry-redux'; +import { doNotify, MODALS } from 'lbry-redux'; import { doClaimRewardType, doRewardList } from 'redux/actions/rewards'; import { selectEmailToVerify, diff --git a/src/renderer/redux/reducers/app.js b/src/renderer/redux/reducers/app.js index ab66a40f8..2cdedcc7c 100644 --- a/src/renderer/redux/reducers/app.js +++ b/src/renderer/redux/reducers/app.js @@ -1,7 +1,7 @@ // @flow import * as ACTIONS from 'constants/action_types'; -import * as MODALS from 'constants/modal_types'; +import { MODALS } from 'lbry-redux'; import { remote } from 'electron'; From deae4982e1a14bbcb1c3b5e9a5f5af5c56eb295d Mon Sep 17 00:00:00 2001 From: btzr-io Date: Sun, 6 May 2018 14:40:30 -0600 Subject: [PATCH 4/5] disable automatic dark mode when dark theme is selected --- src/renderer/page/settings/view.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/renderer/page/settings/view.jsx b/src/renderer/page/settings/view.jsx index 8abe5f088..a3997503a 100644 --- a/src/renderer/page/settings/view.jsx +++ b/src/renderer/page/settings/view.jsx @@ -141,6 +141,7 @@ class SettingsPage extends React.PureComponent { } = this.props; const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0; + const isDarkModeEnabled = currentTheme === 'dark'; return ( @@ -294,6 +295,7 @@ class SettingsPage extends React.PureComponent { name="automatic_dark_mode" onChange={e => this.onAutomaticDarkModeChange(e.target.checked)} checked={automaticDarkModeEnabled} + disabled={isDarkModeEnabled} postfix={__('Automatic dark mode (9pm to 8am)')} /> From 5609ef42f90c2eb57330e56cc5690a163bbd76d6 Mon Sep 17 00:00:00 2001 From: btzr-io Date: Sun, 6 May 2018 15:35:12 -0600 Subject: [PATCH 5/5] fix changelog --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d8c212bd..1cf4143f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,16 +18,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). * Add flair to snackbar ([#1313](https://github.com/lbryio/lbry-app/pull/1313)) ### Fixed - * Black screen on macOS after maximizing LBRY and then closing ([#1235](https://github.com/lbryio/lbry-app/pull/1235)) * Fix content-type not shown correctly in file description ([#863](https://github.com/lbryio/lbry-app/pull/863)) * Fix [Flow](https://flow.org/) ([#1197](https://github.com/lbryio/lbry-app/pull/1197)) - * Black screen on macOS after maximizing LBRY and then closing ([#1235](https://github.com/lbryio/lbry-app/pull/1235)) + * Fix black screen on macOS after maximizing LBRY and then closing ([#1235](https://github.com/lbryio/lbry-app/pull/1235)) * Fix dark theme ([#1034](https://github.com/lbryio/lbry-app/issues/1034)) * Fix download percentage indicator overlay ([#1271](https://github.com/lbryio/lbry-app/issues/1271)) * Fix alternate row shading for transactions on dark theme ([#1355](https://github.com/lbryio/lbry-app/issues/#1355)) - * Fix Description box on Publish (dark theme) ([#1356](https://github.com/lbryio/lbry-app/issues/#1356)) - * Fix spacing in search suggestions ([#1422])(https://github.com/lbryio/lbry-app/pull/1422)) - * Fix text/HTML files don't display correctly in-app anymore ([#1379])(https://github.com/lbryio/lbry-app/issues/1379) + * Fix description box on Publish (dark theme) ([#1356](https://github.com/lbryio/lbry-app/issues/#1356)) + * Fix spacing in search suggestions ([#1422](https://github.com/lbryio/lbry-app/pull/1422)) + * Fix text/HTML files don't display correctly in-app anymore ([#1379](https://github.com/lbryio/lbry-app/issues/1379)) + * Fix don't allow dark mode with automatic night mode enabled ([#1005](https://github.com/lbryio/lbry-app/issues/1005)) ## [0.21.3] - 2018-04-23