From 78ffcb9b71585d24c3f32dc62cffc3af104ce705 Mon Sep 17 00:00:00 2001 From: ewandor Date: Sat, 3 May 2025 18:24:27 +0200 Subject: [PATCH] Allowing RichtextWidget to be readonly --- .../components/widgets/richtext/index.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/gui/rpk-gui/src/lib/crud/components/widgets/richtext/index.tsx b/gui/rpk-gui/src/lib/crud/components/widgets/richtext/index.tsx index 7aecd93..3b74c8a 100644 --- a/gui/rpk-gui/src/lib/crud/components/widgets/richtext/index.tsx +++ b/gui/rpk-gui/src/lib/crud/components/widgets/richtext/index.tsx @@ -57,7 +57,7 @@ const StyledLabelledOutlined = styled(LabelledOutlined)(({ theme }) => [{ const RichtextWidget = ( props: WidgetProps ) => { - const { schema, value, onChange, label, id } = props; + const { schema, value, onChange, label, id, readonly } = props; const isMultiline = schema.props.multiline === true; let editorOptions: UseEditorOptions; @@ -92,14 +92,15 @@ const RichtextWidget = - - {isMultiline ? multilineButtons : singlelineButtons} - - } - variant="standard" - /> + {!readonly && + {isMultiline ? multilineButtons : singlelineButtons} + + } + variant="standard" + />} + {readonly && }