add lock icon to FieldWrapper

This commit is contained in:
Sidney Alcantara
2021-01-09 21:14:23 +11:00
parent 9a2f12ec40
commit 511fab35ff

View File

@@ -9,6 +9,7 @@ import {
} from "@material-ui/core";
import DebugIcon from "@material-ui/icons/BugReportOutlined";
import LaunchIcon from "@material-ui/icons/Launch";
import LockIcon from "@material-ui/icons/Lock";
import ErrorBoundary from "components/ErrorBoundary";
import FieldSkeleton from "./FieldSkeleton";
@@ -20,10 +21,10 @@ const useStyles = makeStyles((theme) =>
header: {
marginBottom: theme.spacing(1),
color: theme.palette.text.disabled,
"& svg": { display: "block" },
},
iconContainer: {
marginRight: theme.spacing(0.5),
"& svg": { display: "block" },
},
disabledText: {
@@ -43,6 +44,7 @@ export interface IFieldWrapperProps {
name?: string;
label?: React.ReactNode;
debugText?: React.ReactNode;
disabled?: boolean;
}
export default function FieldWrapper({
@@ -51,6 +53,7 @@ export default function FieldWrapper({
name,
label,
debugText,
disabled,
}: IFieldWrapperProps) {
const classes = useStyles();
@@ -70,6 +73,11 @@ export default function FieldWrapper({
<Grid item xs>
<Typography variant="caption">{label}</Typography>
</Grid>
{disabled && (
<Grid item>
<LockIcon />
</Grid>
)}
</Grid>
<ErrorBoundary fullScreen={false} basic>