This commit is contained in:
Ren Amamiya
2023-08-09 13:17:07 +07:00
parent d1d0a462f4
commit edf56bc97b
7 changed files with 27 additions and 26 deletions

View File

@@ -9,14 +9,12 @@ export function AvatarUploader({ setPicture }: { setPicture: any }) {
const [loading, setLoading] = useState(false);
const uploadAvatar = async () => {
setLoading(true);
const image = await upload(null);
if (image.url) {
// update parent state
setPicture(image.url);
// disable loader
setLoading(false);
}
setLoading(false);
};
return (