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,47 @@
|
||||
import React from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { TextField } from "@material-ui/core";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
formContainer: {
|
||||
width: "100%",
|
||||
marginTop: "8px",
|
||||
},
|
||||
textField: {
|
||||
width: "100%",
|
||||
},
|
||||
});
|
||||
|
||||
function ProfileField({
|
||||
label,
|
||||
value,
|
||||
handleChange,
|
||||
allowChange,
|
||||
multiline,
|
||||
inputRef,
|
||||
}) {
|
||||
const classes = useStyles();
|
||||
const _handleChange = (e) => handleChange(e.target.value);
|
||||
|
||||
return (
|
||||
<div className={classes.formContainer}>
|
||||
<TextField
|
||||
className={classes.textField}
|
||||
label={label}
|
||||
value={value}
|
||||
onChange={_handleChange}
|
||||
disabled={!allowChange}
|
||||
multiline={multiline}
|
||||
inputRef={inputRef}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
ProfileField.defaultProps = {
|
||||
allowChange: true,
|
||||
multiline: false,
|
||||
inputRef: null,
|
||||
};
|
||||
|
||||
export default ProfileField;
|
||||
Reference in new issue
Block a user