import { createSignal, Show, type JSX, Component } from 'solid-js'; import Cog6Tooth from 'heroicons/24/outline/cog-6-tooth.svg'; import Plus from 'heroicons/24/outline/plus.svg'; import MagnifyingGlass from 'heroicons/24/solid/magnifying-glass.svg'; import PencilSquare from 'heroicons/24/solid/pencil-square.svg'; import Config from '@/components/modal/Config'; import NotePostForm from '@/components/NotePostForm'; import useConfig from '@/core/useConfig'; import { useHandleCommand } from '@/hooks/useCommandBus'; import useModalState from '@/hooks/useModalState'; import resolveAsset from '@/utils/resolveAsset'; const SideBar: Component = () => { let textAreaRef: HTMLTextAreaElement | undefined; const { showAddColumn, showAbout } = useModalState(); const { config } = useConfig(); const [formOpened, setFormOpened] = createSignal(false); const [configOpened, setConfigOpened] = createSignal(false); const focusTextArea = () => { textAreaRef?.focus(); textAreaRef?.click(); }; const openForm = () => setFormOpened(true); const closeForm = () => setFormOpened(false); const toggleForm = () => setFormOpened((current) => !current); useHandleCommand(() => ({ commandType: 'openPostForm', handler: () => { openForm(); if (textAreaRef != null) { setTimeout(() => focusTextArea(), 100); } }, })); return (
); }; export default SideBar;