mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
41 lines
880 B
TypeScript
41 lines
880 B
TypeScript
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;
|