WEBAPP: Панель инструментов редактора - возможность блокировки кнопок
This commit is contained in:
parent
759fc763e2
commit
afbb33c90f
@ -19,6 +19,7 @@ import { IconButton, Icon, Stack } from "@mui/material"; //Интерфейсн
|
|||||||
const P8P_EDITOR_TOOL_BAR_ITEM_SHAPE = PropTypes.shape({
|
const P8P_EDITOR_TOOL_BAR_ITEM_SHAPE = PropTypes.shape({
|
||||||
icon: PropTypes.string.isRequired,
|
icon: PropTypes.string.isRequired,
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
|
disabled: PropTypes.bool,
|
||||||
onClick: PropTypes.func.isRequired
|
onClick: PropTypes.func.isRequired
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ const P8PEditorToolBar = ({ items = [] }) => {
|
|||||||
return (
|
return (
|
||||||
<Stack direction={"row"} p={1}>
|
<Stack direction={"row"} p={1}>
|
||||||
{items.map((item, i) => (
|
{items.map((item, i) => (
|
||||||
<IconButton key={i} onClick={item.onClick} title={item.title}>
|
<IconButton key={i} onClick={item.onClick} title={item.title} disabled={item?.disabled === true}>
|
||||||
<Icon>{item.icon}</Icon>
|
<Icon>{item.icon}</Icon>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
))}
|
))}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user