From b4b29babfd475a723aef91bcff5e60b9d2fb3ecf Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sat, 21 Dec 2024 05:39:11 -0800 Subject: [PATCH] Adjust markdown editor --- src-web/components/MarkdownEditor.tsx | 25 +++++++++++++------ src-web/components/WorkpaceSettingsDialog.tsx | 3 ++- .../components/WorkspaceActionsDropdown.tsx | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src-web/components/MarkdownEditor.tsx b/src-web/components/MarkdownEditor.tsx index 8d5f22d5..a58a728b 100644 --- a/src-web/components/MarkdownEditor.tsx +++ b/src-web/components/MarkdownEditor.tsx @@ -4,13 +4,14 @@ import { useRef } from 'react'; import Markdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import { useKeyValue } from '../hooks/useKeyValue'; -import {Editor} from "./core/Editor/Editor"; +import type { EditorProps } from './core/Editor/Editor'; +import { Editor } from './core/Editor/Editor'; import { IconButton } from './core/IconButton'; import { SplitLayout } from './core/SplitLayout'; import { VStack } from './core/Stacks'; import { Prose } from './Prose'; -interface Props { +interface Props extends Pick { placeholder: string; className?: string; defaultValue: string; @@ -18,7 +19,14 @@ interface Props { name: string; } -export function MarkdownEditor({ className, defaultValue, onChange, name, placeholder }: Props) { +export function MarkdownEditor({ + className, + defaultValue, + onChange, + name, + placeholder, + heightMode, +}: Props) { const containerRef = useRef(null); const [width] = useSize(containerRef.current); @@ -39,13 +47,14 @@ export function MarkdownEditor({ className, defaultValue, onChange, name, placeh const editor = ( ); @@ -96,11 +105,11 @@ export function MarkdownEditor({ className, defaultValue, onChange, name, placeh
-
{contents}
+
{contents}
+ updateWorkspace.mutate({ description })} + heightMode='auto' /> ); diff --git a/src-web/components/WorkspaceActionsDropdown.tsx b/src-web/components/WorkspaceActionsDropdown.tsx index 68d3fa3f..45d6cb9a 100644 --- a/src-web/components/WorkspaceActionsDropdown.tsx +++ b/src-web/components/WorkspaceActionsDropdown.tsx @@ -49,7 +49,7 @@ export const WorkspaceActionsDropdown = memo(function WorkspaceActionsDropdown({ const extraItems: DropdownItem[] = [ { key: 'workspace-settings', - label: 'Settings', + label: 'Workspace Settings', leftSlot: , onSelect: async () => { dialog.show({