mirror of
https://github.com/rowyio/rowy.git
synced 2026-07-12 13:28:48 +02:00
add lock icon to FieldWrapper
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user