From a0a522f1d2ba5e9da1227c2c5753a033ef1ed1f9 Mon Sep 17 00:00:00 2001 From: Clayton Wilson Date: Fri, 6 Dec 2019 12:53:27 -0500 Subject: [PATCH] Display disabled DMs as red and fix errors in login and signup --- twistter-frontend/src/pages/directMessages.js | 16 +++++++++++++--- .../src/redux/actions/userActions.js | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/twistter-frontend/src/pages/directMessages.js b/twistter-frontend/src/pages/directMessages.js index 68f23b9..40f08fb 100644 --- a/twistter-frontend/src/pages/directMessages.js +++ b/twistter-frontend/src/pages/directMessages.js @@ -83,6 +83,10 @@ const styles = { wordBreak: "break-all", color: 'black' }, + dmRecentMessageDisabled: { + wordBreak: "break-all", + color: 'red' + }, dmListItemContainer: { height: 100 }, @@ -105,7 +109,7 @@ const styles = { fontSize: 20, backgroundColor: '#1da1f2', width: 300 - }, + }, messagesGrid: { // // margin: "auto" // height: "auto", @@ -426,9 +430,15 @@ export class directMessages extends Component { diff --git a/twistter-frontend/src/redux/actions/userActions.js b/twistter-frontend/src/redux/actions/userActions.js index ff1366d..7b43e3f 100644 --- a/twistter-frontend/src/redux/actions/userActions.js +++ b/twistter-frontend/src/redux/actions/userActions.js @@ -36,6 +36,7 @@ export const getUserData = () => (dispatch) => { // Sends login data to firebase and sets the user data in Redux export const loginUser = (loginData, history) => (dispatch) => { + dispatch({type: CLEAR_ERRORS}); dispatch({ type: LOADING_UI }); axios .post("/login", loginData) @@ -57,6 +58,7 @@ export const loginUser = (loginData, history) => (dispatch) => { // Sends signup data to firebase and sets the user data in Redux export const signupUser = (newUserData, history) => (dispatch) => { + dispatch({type: CLEAR_ERRORS}); dispatch({ type: LOADING_UI }); axios .post("/signup", newUserData)