mirror of
https://github.com/colanode/colanode.git
synced 2026-02-24 03:49:48 +01:00
Fix some errors and warnings in editor and sidebar
This commit is contained in:
@@ -4,10 +4,10 @@ import { Menu } from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { Sidebar } from '@colanode/ui/components/layouts/sidebars/sidebar';
|
||||
import { Button } from '@colanode/ui/components/ui/button';
|
||||
import {
|
||||
Sheet,
|
||||
SheetContent,
|
||||
SheetDescription,
|
||||
SheetTitle,
|
||||
SheetTrigger,
|
||||
} from '@colanode/ui/components/ui/sheet';
|
||||
@@ -24,16 +24,12 @@ export const SidebarMobile = () => {
|
||||
<Sheet open={open} onOpenChange={setOpen}>
|
||||
<VisuallyHidden>
|
||||
<SheetTitle>Sidebar</SheetTitle>
|
||||
<SheetDescription>Colanode sidebar for mobile devices</SheetDescription>
|
||||
</VisuallyHidden>
|
||||
<SheetTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="size-9"
|
||||
aria-label="Open sidebar"
|
||||
>
|
||||
<Menu className="h-5 w-5" />
|
||||
</Button>
|
||||
<button className="px-1 outline-none" aria-label="Open sidebar">
|
||||
<Menu className="size-4 text-muted-foreground" />
|
||||
</button>
|
||||
</SheetTrigger>
|
||||
<SheetContent
|
||||
side="left"
|
||||
|
||||
@@ -154,10 +154,11 @@ export const MessageCreate = forwardRef<MessageCreateRefProps>((_, ref) => {
|
||||
<div className="max-h-72 flex-grow overflow-y-auto">
|
||||
{conversation.canCreateMessage ? (
|
||||
<MessageEditor
|
||||
key={conversation.id}
|
||||
ref={messageEditorRef}
|
||||
userId={workspace.userId}
|
||||
accountId={workspace.accountId}
|
||||
workspaceId={workspace.id}
|
||||
ref={messageEditorRef}
|
||||
conversationId={conversation.id}
|
||||
rootId={conversation.rootId}
|
||||
onChange={setContent}
|
||||
|
||||
@@ -4,6 +4,7 @@ import isHotkey from 'is-hotkey';
|
||||
import { forwardRef, Fragment, useImperativeHandle } from 'react';
|
||||
|
||||
import { TempFile } from '@colanode/client/types';
|
||||
import { generateId, IdType } from '@colanode/core/lib/id.js';
|
||||
import {
|
||||
BoldMark,
|
||||
CodeBlockNode,
|
||||
@@ -95,6 +96,18 @@ export const MessageEditor = forwardRef<
|
||||
return isHotkey('enter', event);
|
||||
},
|
||||
},
|
||||
content: {
|
||||
type: 'message',
|
||||
content: [
|
||||
{
|
||||
type: 'paragraph',
|
||||
content: [],
|
||||
attrs: {
|
||||
id: generateId(IdType.Block),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
onUpdate: (e) => {
|
||||
props.onChange?.(e.editor.getJSON());
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user