[ ADD ] react configuration
This commit is contained in:
10
react/src/components/Controls/Button/Button.js
Normal file
10
react/src/components/Controls/Button/Button.js
Normal file
@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
import Button from '@material-ui/core/Button';
|
||||
|
||||
export const Btn = ({text , handleClick}) => {
|
||||
return (
|
||||
<Button variant="contained" color="primary" onClick={handleClick}>
|
||||
{text}
|
||||
</Button>
|
||||
);
|
||||
};
|
32
react/src/components/Controls/InputField/InputField.js
Normal file
32
react/src/components/Controls/InputField/InputField.js
Normal file
@ -0,0 +1,32 @@
|
||||
import React from "react";
|
||||
import { TextField } from "@material-ui/core";
|
||||
|
||||
export const InputField = ({
|
||||
name,
|
||||
label,
|
||||
value,
|
||||
error,
|
||||
handleChange,
|
||||
helperText,
|
||||
isMultiline,
|
||||
isRequired
|
||||
}) => {
|
||||
|
||||
return (
|
||||
<TextField
|
||||
className="my-3"
|
||||
name={name}
|
||||
type="text"
|
||||
label={isRequired ? label+"*" : label}
|
||||
inputProps={{ maxLength: isMultiline ? 500 : 50 }}
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
value={value}
|
||||
error={error}
|
||||
helperText={error && helperText}
|
||||
onChange={handleChange}
|
||||
multiline={isMultiline}
|
||||
rows={isMultiline ? 3 : 1}
|
||||
/>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user