mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
reorganization
This commit is contained in:
1 parent
11977c48ef
commit
2a6429c446
24 files changed
+43
-85
No files matched your search
+2
-2
@@ -20,7 +20,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export function TwitterProfile() {
|
||||
export function Profile() {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const { profile } = useProfile();
|
||||
@@ -82,4 +82,4 @@ export function TwitterProfile() {
|
||||
);
|
||||
}
|
||||
|
||||
export default TwitterProfile;
|
||||
export default Profile;
|
||||
@@ -1,49 +0,0 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import Fab from "@material-ui/core/Fab";
|
||||
import PublishIcon from "@material-ui/icons/Publish";
|
||||
import { useProfile } from "../../hooks/useProfile";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
position: "absolute",
|
||||
bottom: "15px",
|
||||
right: "15px",
|
||||
},
|
||||
button: {
|
||||
background: "#00acee",
|
||||
},
|
||||
}));
|
||||
|
||||
const MINIMUM_LOAD_TIME = 750;
|
||||
|
||||
export function ProfileUpdateButton({ handleClick }) {
|
||||
const classes = useStyles();
|
||||
const [minimumLoadPassed, setMimimumLoadPassed] = useState(true);
|
||||
const { updateProfileLoading } = useProfile();
|
||||
|
||||
useEffect(() => {
|
||||
setMimimumLoadPassed(false);
|
||||
const timeout = window.setTimeout(() => {
|
||||
setMimimumLoadPassed(true);
|
||||
}, MINIMUM_LOAD_TIME);
|
||||
return () => window.clearTimeout(timeout);
|
||||
}, [updateProfileLoading]);
|
||||
|
||||
const isLoading = updateProfileLoading || !minimumLoadPassed;
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<Fab
|
||||
className={classes.button}
|
||||
color="primary"
|
||||
onClick={handleClick}
|
||||
disabled={isLoading}
|
||||
>
|
||||
<PublishIcon />
|
||||
</Fab>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ProfileUpdateButton;
|
||||
Reference in new issue
Block a user