-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve sockets #10
Improve sockets #10
Changes from 16 commits
8d72ada
69dcfba
2d65ec6
4e204bd
b23eaa5
ac3b1f0
b1696a9
a749c45
179f6d7
68e3368
bbb1918
ca86282
8af42ae
e33a0f7
eb72b21
1b9289a
70343e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import React, { useState } from "react"; | ||
import React from "react"; | ||
import { Redirect, useHistory } from "react-router-dom"; | ||
import { connect } from "react-redux"; | ||
import { | ||
|
@@ -7,7 +7,6 @@ import { | |
Button, | ||
FormControl, | ||
TextField, | ||
FormHelperText, | ||
Hidden, | ||
} from "@material-ui/core"; | ||
import { register } from "./store/utils/thunkCreators"; | ||
|
@@ -18,7 +17,6 @@ import HomeSideBanner from "./components/HomeSideBanner/HomeSideBanner"; | |
const Login = (props) => { | ||
const history = useHistory(); | ||
const { user, register } = props; | ||
const [formErrorMessage, setFormErrorMessage] = useState({}); | ||
const classes = useStyles() | ||
|
||
const handleRegister = async (event) => { | ||
|
@@ -72,7 +70,7 @@ const Login = (props) => { | |
className={classes.input} | ||
/> | ||
</FormControl> | ||
<FormControl margin='normal' className={classes.full} error={!!formErrorMessage.confirmPassword}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the changes in this file related to this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 75 was extraneous code from when there was still a confirm-password field on signup. I realized (after completing the login and signup redesign) that I had left that line there; even though it's a single line, is it generally best practice to just make that change in the login/signup-redesign branch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally, best practice would be to open a new PR to do cleanup like this. If you want to include it in an unrelated PR like you've done here, it's helpful to reviewers to mention it in the PR description. I wouldn't remove it from this PR at this point. |
||
<FormControl margin='normal' className={classes.full}> | ||
<TextField | ||
aria-label="password" | ||
label="Password" | ||
|
@@ -81,9 +79,6 @@ const Login = (props) => { | |
name="password" | ||
className={classes.input} | ||
/> | ||
<FormHelperText> | ||
{formErrorMessage.confirmPassword} | ||
</FormHelperText> | ||
</FormControl> | ||
<Button | ||
type="submit" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from "react"; | ||
import { makeStyles } from "@material-ui/core/styles"; | ||
import { Box, Typography, Avatar } from "@material-ui/core"; | ||
|
||
const useStyles = makeStyles(() => ({ | ||
root: { | ||
display: "flex" | ||
}, | ||
avatar: { | ||
height: 30, | ||
width: 30, | ||
marginRight: 11, | ||
marginTop: 6 | ||
}, | ||
usernameDate: { | ||
fontSize: 11, | ||
color: "#BECCE2", | ||
fontWeight: "bold", | ||
marginBottom: 5 | ||
}, | ||
bubble: { | ||
backgroundImage: "linear-gradient(225deg, #6CC1FF 0%, #3A8DFF 100%)", | ||
borderRadius: "0 10px 10px 10px", | ||
padding: '10px 15px', | ||
display: 'flex', | ||
}, | ||
text: { | ||
fontSize: 14, | ||
fontWeight: "bold", | ||
color: "#FFFFFF", | ||
letterSpacing: -0.2, | ||
padding: 8 | ||
}, | ||
dot: { | ||
height: '10px', | ||
width: '10px', | ||
borderRadius: '100%', | ||
display: 'inline-block', | ||
backgroundColor: 'rgb(250, 250, 250, 0.6)', | ||
margin: '2px', | ||
animation: '$typing-dot 1.2s ease-in-out 1.2s infinite', | ||
"&:nth-of-type(2)": { | ||
animationDelay: '0.15s', | ||
}, | ||
"&:nth-of-type(3)": { | ||
animationDelay: '0.25s', | ||
}, | ||
}, | ||
'@keyframes typing-dot': { | ||
'15%': { | ||
transform: 'translateY(-35%)', | ||
opacity: 0.1 | ||
}, | ||
'30%': { | ||
transform: 'translateY(0%)', | ||
opacity: 1, | ||
}, | ||
}, | ||
})); | ||
|
||
const TypingIndicator = (props) => { | ||
const classes = useStyles(); | ||
const { otherUser } = props; | ||
return ( | ||
<Box className={classes.root}> | ||
<Avatar alt={otherUser.username} src={otherUser.photoUrl} className={classes.avatar}></Avatar> | ||
<Box> | ||
<Typography className={classes.usernameDate}> | ||
{otherUser.username} | ||
</Typography> | ||
<Box className={classes.bubble}> | ||
<Typography className={classes.dot}></Typography> | ||
<Typography className={classes.dot}></Typography> | ||
<Typography className={classes.dot}></Typography> | ||
</Box> | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default TypingIndicator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest using
Box
here instead of'div'
- since this project uses Material UI, it'd be better to stick to using Material UI components instead of mixing regular jsx in to keep things consistent.