Skip to content

Commit

Permalink
disabled split button theme-ing
Browse files Browse the repository at this point in the history
  • Loading branch information
ritch committed Nov 22, 2024
1 parent f692b3a commit 1b8709d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 14 additions & 3 deletions app/packages/operators/src/SplitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ListItemText,
Tooltip,
ButtonProps,
Box,
} from "@mui/material";
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
import { onEnter } from "./utils";
Expand Down Expand Up @@ -144,9 +145,19 @@ export default function SplitButton({
<PrimaryWithTag
label={option.choiceLabel || option.label}
tag={option.tag}
disabled={option.disabled || !option.onClick}
/>
}
secondary={option.description}
secondary={
<Box
sx={{
fontSize: "11px",
"& *": { fontSize: "inherit" },
}}
>
{option.description}
</Box>
}
/>
</MenuItem>
))}
Expand All @@ -161,13 +172,13 @@ export default function SplitButton({
);
}

function PrimaryWithTag({ label, tag }) {
function PrimaryWithTag({ label, tag, disabled }) {
const theme = useTheme();
const tagEl = tag ? (
<span
style={{
fontSize: "11px",
color: theme.custom.primarySoft,
color: disabled ? theme.text.secondary : theme.custom.primarySoft,
marginLeft: "5px",
}}
>
Expand Down
1 change: 1 addition & 0 deletions app/packages/operators/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ const useOperatorPromptSubmitOptions = (
options.push({
label: "Schedule",
choiceLabel: `Schedule`,
tag: "NOT AVAILABLE",
id: "disabled-schedule",
description: markdownDesc,
isDelegated: true,
Expand Down

0 comments on commit 1b8709d

Please sign in to comment.