mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
working typescript version
This commit is contained in:
1 parent
581d6011e0
commit
cff746aa38
119 files changed
+247
-189
No files matched your search
@@ -0,0 +1,49 @@
|
||||
import React, { useState } from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||
import { useProfile } from "../../hooks/useProfile";
|
||||
import ProfileField from "./ProfileField";
|
||||
import ProfileUpdateButton from "../buttons/ProfileUpdateButton";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
position: "relative",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
padding: "15px",
|
||||
},
|
||||
spacer: {
|
||||
height: "8px",
|
||||
},
|
||||
}));
|
||||
|
||||
export function ProfilePrompt() {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const { profile } = useProfile();
|
||||
const [name, handleNameChange] = useState(profile.profile_name || "");
|
||||
|
||||
const handleUpdate = () => {
|
||||
const data = {
|
||||
...profile,
|
||||
profile_name: name,
|
||||
};
|
||||
Nui.send("phone:updateTwitterProfile", data);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<ProfileField
|
||||
label={t("APPS_TWITTER_EDIT_PROFILE_NAME")}
|
||||
value={name}
|
||||
handleChange={handleNameChange}
|
||||
allowChange
|
||||
/>
|
||||
<ProfileUpdateButton handleClick={handleUpdate} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ProfilePrompt;
|
||||
Reference in new issue
Block a user