Display disabled DMs as red and fix errors in login and signup

This commit is contained in:
Clayton Wilson 2019-12-06 12:53:27 -05:00
parent 988c807af2
commit a0a522f1d2
2 changed files with 15 additions and 3 deletions

View File

@ -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 {
<Typography
className={
this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? (
classes.dmRecentMessageSelected
channel.hasDirectMessagesEnabled ?
classes.dmRecentMessageSelected
:
classes.dmRecentMessageDisabled
) : (
classes.dmRecentMessageUnselected
channel.hasDirectMessagesEnabled ?
classes.dmRecentMessageUnselected
:
classes.dmRecentMessageDisabled
)
}
>

View File

@ -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)