Skip to content

Commit 9cd6af8

Browse files
committed
Added border and disabled settings
1 parent de29a3d commit 9cd6af8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/ui/widgets/ActionButton/actionButton.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useContext } from "react";
22
import { WidgetActions, executeActions } from "../widgetActions";
3-
import { commonCss, Widget } from "../widget";
3+
import { Widget } from "../widget";
44
import { PVComponent, PVWidgetPropType } from "../widgetProps";
55
import classes from "./actionButton.module.css";
66
import { registerWidget } from "../register";
@@ -15,7 +15,7 @@ import {
1515
} from "../propTypes";
1616
import { Color } from "../../../types/color";
1717
import { Font } from "../../../types/font";
18-
import { Border, BorderStyle } from "../../../types/border";
18+
import { Border } from "../../../types/border";
1919
import { MacroContext } from "../../../types/macros";
2020
import { ExitFileContext, FileContext } from "../../../misc/fileContext";
2121
import { Button } from "@mui/material";
@@ -43,7 +43,8 @@ const ActionButtonPropType = {
4343
foregroundColor: ColorPropOpt,
4444
font: FontPropOpt,
4545
border: BorderPropOpt,
46-
visible: BoolPropOpt
46+
visible: BoolPropOpt,
47+
disabled: BoolPropOpt
4748
};
4849

4950
const ActionButtonWidgetProps = {
@@ -72,12 +73,14 @@ export const ActionButtonWidget = (
7273
<ThemeProvider theme={defaultColours}>
7374
<Button
7475
variant="contained"
76+
disabled={props.disabled}
7577
sx={{
7678
height: "100%",
7779
width: "100%",
7880
fontFamily: props.font?.css() ?? "",
7981
color: props.foregroundColor?.toString() ?? defaultColours.palette.primary.contrastText,
8082
backgroundColor: props.backgroundColor?.toString() ?? defaultColours.palette.primary.main,
83+
border: props.border?.css() ?? ""
8184
}}
8285
onClick={onClick}
8386
>
@@ -91,7 +94,7 @@ export const ActionButtonWidget = (
9194
<figcaption>{props.text}</figcaption>
9295
</figure>
9396
) : (
94-
props.text ?? ""
97+
props.text ?? ""
9598
)}
9699
</Button>
97100
</ThemeProvider>

0 commit comments

Comments
 (0)