Merge pull request #114 from ClaytonWWilson/temp-branch

Display disabled DMs as red and fix errors in login and signup
This commit is contained in:
Clayton Wilson 2019-12-06 12:53:57 -05:00 committed by GitHub
commit 978af53a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -83,6 +83,10 @@ const styles = {
wordBreak: "break-all", wordBreak: "break-all",
color: 'black' color: 'black'
}, },
dmRecentMessageDisabled: {
wordBreak: "break-all",
color: 'red'
},
dmListItemContainer: { dmListItemContainer: {
height: 100 height: 100
}, },
@ -426,9 +430,15 @@ export class directMessages extends Component {
<Typography <Typography
className={ className={
this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? ( this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? (
channel.hasDirectMessagesEnabled ?
classes.dmRecentMessageSelected classes.dmRecentMessageSelected
:
classes.dmRecentMessageDisabled
) : ( ) : (
channel.hasDirectMessagesEnabled ?
classes.dmRecentMessageUnselected 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 // Sends login data to firebase and sets the user data in Redux
export const loginUser = (loginData, history) => (dispatch) => { export const loginUser = (loginData, history) => (dispatch) => {
dispatch({type: CLEAR_ERRORS});
dispatch({ type: LOADING_UI }); dispatch({ type: LOADING_UI });
axios axios
.post("/login", loginData) .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 // Sends signup data to firebase and sets the user data in Redux
export const signupUser = (newUserData, history) => (dispatch) => { export const signupUser = (newUserData, history) => (dispatch) => {
dispatch({type: CLEAR_ERRORS});
dispatch({ type: LOADING_UI }); dispatch({ type: LOADING_UI });
axios axios
.post("/signup", newUserData) .post("/signup", newUserData)