From 70b95f2f6138850886b450dba16f2999cc516826 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 19 Oct 2018 16:38:07 -0400 Subject: [PATCH 1/2] subscription improvements --- flow-typed/npm/reselect_v3.x.x.js | 895 ++++++++++++++++++ package.json | 6 +- src/renderer/analytics.js | 7 +- .../component/common/credit-amount.jsx | 12 +- src/renderer/component/fileCard/view.jsx | 15 +- src/renderer/component/fileList/view.jsx | 13 +- src/renderer/component/filePrice/view.jsx | 6 +- src/renderer/component/publishForm/view.jsx | 2 +- src/renderer/component/sideBar/index.js | 4 +- src/renderer/component/sideBar/view.jsx | 15 +- .../component/subscribeButton/index.js | 16 +- .../component/subscribeButton/view.jsx | 10 +- src/renderer/component/userHistory/view.jsx | 4 +- src/renderer/constants/action_types.js | 5 +- src/renderer/constants/icons.js | 2 + ...notification_types.js => subscriptions.js} | 4 + src/renderer/index.js | 1 + .../modal/modalWalletDecrypt/view.jsx | 2 +- src/renderer/page/file/index.js | 10 +- src/renderer/page/file/view.jsx | 81 +- src/renderer/page/fileListDownloaded/view.jsx | 2 +- src/renderer/page/fileListPublished/view.jsx | 4 +- src/renderer/page/settings/view.jsx | 12 +- src/renderer/page/subscriptions/index.js | 19 +- src/renderer/page/subscriptions/view.jsx | 164 +++- src/renderer/redux/actions/content.js | 54 +- src/renderer/redux/actions/subscriptions.js | 301 +++--- src/renderer/redux/reducers/subscriptions.js | 162 ++-- src/renderer/redux/selectors/app.js | 15 +- src/renderer/redux/selectors/subscriptions.js | 179 +++- src/renderer/scss/_gui.scss | 26 +- src/renderer/scss/all.scss | 4 +- src/renderer/scss/component/_badge.scss | 21 + src/renderer/scss/component/_button.scss | 17 + src/renderer/scss/component/_file-list.scss | 11 +- src/renderer/store.js | 2 +- src/renderer/types/file_info.js | 1 + src/renderer/types/redux.js | 2 +- src/renderer/types/subscription.js | 103 +- webpack.renderer.additions.js | 1 + yarn.lock | 10 +- 41 files changed, 1733 insertions(+), 487 deletions(-) create mode 100644 flow-typed/npm/reselect_v3.x.x.js rename src/renderer/constants/{notification_types.js => subscriptions.js} (52%) create mode 100644 src/renderer/scss/component/_badge.scss diff --git a/flow-typed/npm/reselect_v3.x.x.js b/flow-typed/npm/reselect_v3.x.x.js new file mode 100644 index 000000000..eac021fd3 --- /dev/null +++ b/flow-typed/npm/reselect_v3.x.x.js @@ -0,0 +1,895 @@ +// flow-typed signature: 84ab000391e0f17dd212d57ed0b180f5 +// flow-typed version: 5d8678f464/reselect_v3.x.x/flow_>=v0.47.x + +type ExtractReturnType = ((...rest: any[]) => Return) => Return; + +declare module "reselect" { + declare type InputSelector<-TState, TProps, TResult> = + (state: TState, props: TProps, ...rest: any[]) => TResult + + declare type OutputSelector<-TState, TProps, TResult> = + & InputSelector + & { + recomputations(): number, + resetRecomputations(): void, + resultFunc(state: TState, props: TProps, ...rest: Array): TResult, + }; + + declare type SelectorCreator = { + ( + selector1: InputSelector, + resultFunc: (arg1: T1) => TResult + ): OutputSelector, + ( + selectors: [InputSelector], + resultFunc: (arg1: T1) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + resultFunc: (arg1: T1, arg2: T2) => TResult + ): OutputSelector, + ( + selectors: [InputSelector, InputSelector], + resultFunc: (arg1: T1, arg2: T2) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + resultFunc: (arg1: T1, arg2: T2, arg3: T3) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: (arg1: T1, arg2: T2, arg3: T3) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + resultFunc: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + resultFunc: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6 + ) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6 + ) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7 + ) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7 + ) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8 + ) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8 + ) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + selector9: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9 + ) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9 + ) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + selector9: InputSelector, + selector10: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10 + ) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10 + ) => TResult + ): OutputSelector, + + ( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + selector9: InputSelector, + selector10: InputSelector, + selector11: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11 + ) => TResult + ): OutputSelector, + ( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11 + ) => TResult + ): OutputSelector, + + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12 + >( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + selector9: InputSelector, + selector10: InputSelector, + selector11: InputSelector, + selector12: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12 + ) => TResult + ): OutputSelector, + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12 + >( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12 + ) => TResult + ): OutputSelector, + + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13 + >( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + selector9: InputSelector, + selector10: InputSelector, + selector11: InputSelector, + selector12: InputSelector, + selector13: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12, + arg13: T13 + ) => TResult + ): OutputSelector, + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13 + >( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12, + arg13: T13 + ) => TResult + ): OutputSelector, + + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14 + >( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + selector9: InputSelector, + selector10: InputSelector, + selector11: InputSelector, + selector12: InputSelector, + selector13: InputSelector, + selector14: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12, + arg13: T13, + arg14: T14 + ) => TResult + ): OutputSelector, + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14 + >( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12, + arg13: T13, + arg14: T14 + ) => TResult + ): OutputSelector, + + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14, + T15 + >( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + selector9: InputSelector, + selector10: InputSelector, + selector11: InputSelector, + selector12: InputSelector, + selector13: InputSelector, + selector14: InputSelector, + selector15: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12, + arg13: T13, + arg14: T14, + arg15: T15 + ) => TResult + ): OutputSelector, + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14, + T15 + >( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12, + arg13: T13, + arg14: T14, + arg15: T15 + ) => TResult + ): OutputSelector, + + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14, + T15, + T16 + >( + selector1: InputSelector, + selector2: InputSelector, + selector3: InputSelector, + selector4: InputSelector, + selector5: InputSelector, + selector6: InputSelector, + selector7: InputSelector, + selector8: InputSelector, + selector9: InputSelector, + selector10: InputSelector, + selector11: InputSelector, + selector12: InputSelector, + selector13: InputSelector, + selector14: InputSelector, + selector15: InputSelector, + selector16: InputSelector, + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12, + arg13: T13, + arg14: T14, + arg15: T15, + arg16: T16 + ) => TResult + ): OutputSelector, + < + TState, + TProps, + TResult, + T1, + T2, + T3, + T4, + T5, + T6, + T7, + T8, + T9, + T10, + T11, + T12, + T13, + T14, + T15, + T16 + >( + selectors: [ + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector, + InputSelector + ], + resultFunc: ( + arg1: T1, + arg2: T2, + arg3: T3, + arg4: T4, + arg5: T5, + arg6: T6, + arg7: T7, + arg8: T8, + arg9: T9, + arg10: T10, + arg11: T11, + arg12: T12, + arg13: T13, + arg14: T14, + arg15: T15, + arg16: T16 + ) => TResult + ): OutputSelector + }; + + declare type Reselect = { + createSelector: SelectorCreator, + + defaultMemoize: ( + func: TFunc, + equalityCheck?: (a: any, b: any) => boolean + ) => TFunc, + + createSelectorCreator: ( + memoize: Function, + ...memoizeOptions: any[] + ) => SelectorCreator, + + createStructuredSelector: }>( + inputSelectors: InputSelectors, + selectorCreator?: SelectorCreator + ) => OutputSelector> + }; + + declare module.exports: Reselect; +} diff --git a/package.json b/package.json index 5590957e9..db3484c92 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", "keytar": "^4.2.1", - "lbry-redux": "lbryio/lbry-redux#67cae46983d9fea90dd1e4c5bd121dd5077a3f0e", - "lbryinc": "lbryio/lbryinc#de7ff055605b02a24821f0f9bab1d206eb7f235d", + "lbry-redux": "lbryio/lbry-redux#957d221c1830ecbb7a9e74fad78e711fb14539f4", + "lbryinc": "lbryio/lbryinc#3f34af546ee73ff2ee7d8ad05e540b3b0aa658fb", "localforage": "^1.7.1", "mammoth": "^1.4.6", "mime": "^2.3.1", @@ -91,7 +91,7 @@ "axios": "^0.18.0", "babel-eslint": "^8.2.2", "babel-plugin-module-resolver": "^3.1.1", - "babel-polyfill": "^6.20.0", + "babel-polyfill": "^6.26.0", "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-2": "^6.18.0", diff --git a/src/renderer/analytics.js b/src/renderer/analytics.js index 68454249c..1fab23a27 100644 --- a/src/renderer/analytics.js +++ b/src/renderer/analytics.js @@ -52,7 +52,12 @@ const analytics: Analytics = { onSuccessCb: ?() => void ): void => { if (analyticsEnabled) { - const params = { + const params: { + uri: string, + outpoint: string, + claim_id: string, + time_to_start?: number, + } = { uri, outpoint, claim_id: claimId, diff --git a/src/renderer/component/common/credit-amount.jsx b/src/renderer/component/common/credit-amount.jsx index 67243394f..79c4adc54 100644 --- a/src/renderer/component/common/credit-amount.jsx +++ b/src/renderer/component/common/credit-amount.jsx @@ -14,7 +14,7 @@ type Props = { showLBC?: boolean, fee?: boolean, inheritStyle?: boolean, - filePage?: boolean, + badge?: boolean, }; class CreditAmount extends React.PureComponent { @@ -38,7 +38,7 @@ class CreditAmount extends React.PureComponent { fee, showLBC, inheritStyle, - filePage, + badge, } = this.props; const minimumRenderableAmount = 10 ** (-1 * precision); @@ -78,11 +78,13 @@ class CreditAmount extends React.PureComponent { {amountText} diff --git a/src/renderer/component/fileCard/view.jsx b/src/renderer/component/fileCard/view.jsx index bb2df3780..4beb91860 100644 --- a/src/renderer/component/fileCard/view.jsx +++ b/src/renderer/component/fileCard/view.jsx @@ -27,9 +27,15 @@ type Props = { isResolvingUri: boolean, /* eslint-enable react/no-unused-prop-types */ isSubscribed: boolean, + showSubscribedLogo: boolean, + isNew: boolean, }; class FileCard extends React.PureComponent { + static defaultProps = { + showSubscribedLogo: false, + }; + componentWillMount() { this.resolve(this.props); } @@ -57,6 +63,8 @@ class FileCard extends React.PureComponent { claimIsMine, pending, isSubscribed, + isNew, + showSubscribedLogo, } = this.props; if (!claim && !pending) { @@ -112,10 +120,15 @@ class FileCard extends React.PureComponent {
{isRewardContent && } - {isSubscribed && } + {showSubscribedLogo && isSubscribed && } {fileInfo && }
+ {isNew && ( +
+ {__('NEW')} +
+ )} ); /* eslint-enable jsx-a11y/click-events-have-key-events */ diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx index b7863547c..182461a48 100644 --- a/src/renderer/component/fileList/view.jsx +++ b/src/renderer/component/fileList/view.jsx @@ -147,6 +147,7 @@ class FileList extends React.PureComponent { claim_id: claimId, txid, nout, + isNew, } = fileInfo; const uriParams = {}; @@ -159,13 +160,13 @@ class FileList extends React.PureComponent { const outpoint = `${txid}:${nout}`; // See https://github.com/lbryio/lbry-desktop/issues/1327 for discussion around using outpoint as the key - content.push(); + content.push(); }); return (
-
- {!hideFilter && ( + {!hideFilter && ( +
{ - )} -
-
{content}
+
+ )} +
{content}
); } diff --git a/src/renderer/component/filePrice/view.jsx b/src/renderer/component/filePrice/view.jsx index 0dd645a2f..91650b2cf 100644 --- a/src/renderer/component/filePrice/view.jsx +++ b/src/renderer/component/filePrice/view.jsx @@ -10,7 +10,7 @@ type Props = { fetching: boolean, claim: ?{}, // below props are just passed to - filePage?: boolean, + badge?: boolean, inheritStyle?: boolean, showLBC?: boolean, hideFree?: boolean, // hide the file price if it's free @@ -38,7 +38,7 @@ class FilePrice extends React.PureComponent { }; render() { - const { costInfo, showFullPrice, filePage, inheritStyle, showLBC, hideFree } = this.props; + const { costInfo, showFullPrice, badge, inheritStyle, showLBC, hideFree } = this.props; if (costInfo && !costInfo.cost && hideFree) { return null; @@ -47,7 +47,7 @@ class FilePrice extends React.PureComponent { return costInfo ? ( { step="any" label={__('Deposit')} postfix="LBC" - value={bid || ''} + value={bid} error={bidError} min="0" disabled={!name} diff --git a/src/renderer/component/sideBar/index.js b/src/renderer/component/sideBar/index.js index 36fc0d811..228effe74 100644 --- a/src/renderer/component/sideBar/index.js +++ b/src/renderer/component/sideBar/index.js @@ -1,11 +1,11 @@ import { connect } from 'react-redux'; import { selectNavLinks } from 'redux/selectors/app'; -import { selectNotifications } from 'redux/selectors/subscriptions'; +import { selectUnreadAmount } from 'redux/selectors/subscriptions'; import SideBar from './view'; const select = state => ({ navLinks: selectNavLinks(state), - notifications: selectNotifications(state), + unreadSubscriptionTotal: selectUnreadAmount(state), }); const perform = () => ({}); diff --git a/src/renderer/component/sideBar/view.jsx b/src/renderer/component/sideBar/view.jsx index becc2d3ed..81875dbac 100644 --- a/src/renderer/component/sideBar/view.jsx +++ b/src/renderer/component/sideBar/view.jsx @@ -2,7 +2,6 @@ import * as React from 'react'; import Button from 'component/button'; import classnames from 'classnames'; -import * as NOTIFICATION_TYPES from 'constants/notification_types'; type SideBarLink = { label: string, @@ -17,15 +16,11 @@ type Props = { primary: Array, secondary: Array, }, - notifications: { - type: string, - }, + unreadSubscriptionTotal: number, }; const SideBar = (props: Props) => { - const { navLinks, notifications } = props; - - const badges = Object.keys(notifications).length; + const { navLinks, unreadSubscriptionTotal } = props; return (