-
Notifications
You must be signed in to change notification settings - Fork 5
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
Avatar image component #140
base: main
Are you sure you want to change the base?
Conversation
…to 138-avatar-image-component
…to 138-avatar-image-component
import Button from '../../../../Components/Button'; | ||
import useStyles from './style'; | ||
|
||
export default function index() { |
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.
Instead of index
you should give this the component name UserAvatar
- it'll help with debugging
<div className={classes.formContainer}> | ||
<form className={classes.avtarForm} onSubmit={handleSubmitImage}> | ||
<label htmlFor="file-input-select"> | ||
Chose file |
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.
Choose
<form className={classes.avtarForm} onSubmit={handleSubmitImage}> | ||
<label htmlFor="file-input-select"> | ||
Chose file | ||
<input |
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 suggest that you add the accepts
attribute to the file input to make sure the user can only upload images
const [selectedFile, setSelectedFile] = useState(); | ||
const [errorMsg, setErrorMsg] = useState(''); | ||
|
||
const previewFile = (file) => { |
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.
This is awesome
Relates #138
…to 138-avatar-image-component
…to 138-avatar-image-component
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.
solve conflicts
#138
UserAvatar Component