From d37dc773905d9783b3f6a9af49f47b7b3be76c0d Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 11 Feb 2019 11:37:47 -0400 Subject: [PATCH 01/18] - Fixed filter function within CommonMessageReducer - Fixed message count entering negative values --- src/reducers/CommonMessageReducer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/reducers/CommonMessageReducer.js b/src/reducers/CommonMessageReducer.js index bbf05bb91..7a234fbe6 100644 --- a/src/reducers/CommonMessageReducer.js +++ b/src/reducers/CommonMessageReducer.js @@ -31,21 +31,21 @@ export default function(state = initialState, action) { // get current state of messages // operate on the one matching supplied id let messageCount = state.get('messageCount'); - const newMessageCount = --messageCount; + const newMessageCount = messageCount > 0 ? --messageCount : 0; // cannot have negative count const id = action.id; const newHeaderMsgState = state.get('headerMessages') .filter((m) => { let mID = m.get('id'); - // Filter exchange messages. - return mID === 'h' + id; + // // Filter exchange messages. + return mID !== id; }); const newsideBarMessagestate = state.get('sideBarMessages') .filter((m) => { let mID = m.get('id'); // Filter betslip messages. - return mID === 's' + id; + return mID !== id; }); return state.set('headerMessages', newHeaderMsgState) From a5d7c110d0fcb75edfeb27d4df8883616b7b72ca Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 11 Feb 2019 13:39:15 -0400 Subject: [PATCH 02/18] fixed notification sitting behind the aside --- src/assets/stylesheets/modules/_aside.scss | 1 + src/assets/stylesheets/modules/_header.scss | 3 +-- src/components/AppContainer.jsx | 3 ++- src/components/Dashboard/Balances/Balances.jsx | 11 ++++++++--- .../Dashboard/Balances/BalancesContainer.jsx | 2 -- src/components/Dashboard/Balances/Side.jsx | 10 +++++----- src/components/Header/Header.jsx | 4 +++- src/reducers/CommonMessageReducer.js | 15 ++++++++------- 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/assets/stylesheets/modules/_aside.scss b/src/assets/stylesheets/modules/_aside.scss index faa254153..393cca163 100644 --- a/src/assets/stylesheets/modules/_aside.scss +++ b/src/assets/stylesheets/modules/_aside.scss @@ -4,6 +4,7 @@ right: 0; top: $headerHeight; bottom: 0; + position: fixed; float: right; max-width: 450px; min-width: 250px; diff --git a/src/assets/stylesheets/modules/_header.scss b/src/assets/stylesheets/modules/_header.scss index 54460fd17..86b40cf0c 100644 --- a/src/assets/stylesheets/modules/_header.scss +++ b/src/assets/stylesheets/modules/_header.scss @@ -8,11 +8,10 @@ height: $headerHeight; background: $clear-color2; @include box-shadow(0 2px 7px rgba(0, 0, 0, 0.08)); - padding: 0 0 0 18px; .box { @include clearfix; height: 100%; - padding: 0; + padding: 0 0 0 18px; } } \ No newline at end of file diff --git a/src/components/AppContainer.jsx b/src/components/AppContainer.jsx index 8271a35ea..ef9a41702 100644 --- a/src/components/AppContainer.jsx +++ b/src/components/AppContainer.jsx @@ -57,7 +57,8 @@ class App extends React.Component { content = (
-
{this.props.children} +
+ {this.props.children}
); } diff --git a/src/components/Dashboard/Balances/Balances.jsx b/src/components/Dashboard/Balances/Balances.jsx index 647333ee9..db5e6b854 100644 --- a/src/components/Dashboard/Balances/Balances.jsx +++ b/src/components/Dashboard/Balances/Balances.jsx @@ -34,6 +34,10 @@ class Balances extends React.Component { this.props.navigateToDepositWithDraw(symbol); } + getMargin() { + return this.props.activeNotification ? '35px' : '0px'; + } + renderBalanceList(list, title, showHideOption, onAfterChangeShow, onAfterChangeHide) { return ( -
+
); } From 77a15e338b961acd77322d1de99e33193add970f Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 26 Feb 2019 11:29:30 -0400 Subject: [PATCH 05/18] common message component now only renders when location is called + fixed sidebar messaging --- src/components/AppContainer.jsx | 5 +++-- src/components/CommonMessage/CommonMessage.jsx | 11 ++++++++--- src/components/CommonMessage/CommonMessage.scss | 3 +++ src/components/Dashboard/Balances/Side.jsx | 5 +++-- src/reducers/CommonMessageReducer.js | 1 - 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/components/AppContainer.jsx b/src/components/AppContainer.jsx index 5b54cd175..35d4cd241 100644 --- a/src/components/AppContainer.jsx +++ b/src/components/AppContainer.jsx @@ -56,11 +56,11 @@ class App extends React.Component { document.getElementsByTagName('body')[0].className = 'loginBg'; content = (
{this.props.children}
); } else { - + console.log('header size: ', this.props.headerMessages.size ); content = (
- + {this.props.headerMessages.size > 0 ? : null } {this.props.activeNotification ?
{this.props.children}
: @@ -107,6 +107,7 @@ const mapStateToProps = (state) => { showHelpPopup: state.helpReducer.showHelpModal, locale: state.settings.locale, activeNotification: state.commonMessage.get('activeMessage'), + headerMessages: state.commonMessage.get('headerMessages') }; }; diff --git a/src/components/CommonMessage/CommonMessage.jsx b/src/components/CommonMessage/CommonMessage.jsx index 314139d9d..d4a687f00 100644 --- a/src/components/CommonMessage/CommonMessage.jsx +++ b/src/components/CommonMessage/CommonMessage.jsx @@ -27,7 +27,7 @@ const compileMessage = (props) => { return (
@@ -56,7 +56,7 @@ class CommonMessage extends PureComponent { setTimer(id) { const {timeout} = this.state; clearTimeout(timeout); - + console.log('setting timer') this.setState({ timeout: setTimeout( this.props.clearMessage.bind(this, id), Config.commonMessageModule.timeout @@ -83,7 +83,12 @@ class CommonMessage extends PureComponent { this.checkToAssignTimer(propsMerged); } } - + + componentDidMount() { + let propsMerged = this.props.headerMessages.concat(this.props.sideBarMessages); + this.checkToAssignTimer(propsMerged); + } + render() { return (
diff --git a/src/components/CommonMessage/CommonMessage.scss b/src/components/CommonMessage/CommonMessage.scss index 0eb24e95a..2841435af 100644 --- a/src/components/CommonMessage/CommonMessage.scss +++ b/src/components/CommonMessage/CommonMessage.scss @@ -13,6 +13,9 @@ animation-duration: 0.2s; animation-timing-function: ease-in-out; animation-fill-mode: forwards; + &.small { + width: 24%; + } p { float: right; &:hover { diff --git a/src/components/Dashboard/Balances/Side.jsx b/src/components/Dashboard/Balances/Side.jsx index 7a590df9d..8ea54b562 100644 --- a/src/components/Dashboard/Balances/Side.jsx +++ b/src/components/Dashboard/Balances/Side.jsx @@ -38,7 +38,7 @@ class Side extends React.Component { return (