mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-18 06:24:25 +01:00
update
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { createSignal, Show, type JSX, Component } from 'solid-js';
|
||||
import MagnifyingGlass from 'heroicons/24/solid/magnifying-glass.svg';
|
||||
import PencilSquare from 'heroicons/24/solid/pencil-square.svg';
|
||||
import Cog6Tooth from 'heroicons/24/outline/cog-6-tooth.svg';
|
||||
|
||||
import NotePostForm from '@/components/NotePostForm';
|
||||
import Config from '@/components/Config';
|
||||
|
||||
import useConfig from '@/nostr/useConfig';
|
||||
import useCommands from '@/nostr/useCommands';
|
||||
@@ -11,11 +13,12 @@ import { useHandleCommand } from '@/hooks/useCommandBus';
|
||||
|
||||
const SideBar: Component = () => {
|
||||
let formTextAreaRef: HTMLTextAreaElement | undefined;
|
||||
const [config] = useConfig();
|
||||
const { config } = useConfig();
|
||||
const getPubkey = usePubkey();
|
||||
const commands = useCommands();
|
||||
|
||||
const [formOpened, setFormOpened] = createSignal(false);
|
||||
const [configOpened, setConfigOpened] = createSignal(false);
|
||||
|
||||
const openForm = () => {
|
||||
setFormOpened(true);
|
||||
@@ -57,22 +60,36 @@ const SideBar: Component = () => {
|
||||
|
||||
return (
|
||||
<div class="flex shrink-0 flex-row border-r bg-sidebar-bg">
|
||||
<div class="flex w-14 flex-auto flex-col items-center gap-3 border-r border-rose-200 py-5">
|
||||
<button
|
||||
class={`h-9 w-9 rounded-full border border-primary bg-primary p-2 text-2xl font-bold text-white`}
|
||||
onClick={() => setFormOpened((current) => !current)}
|
||||
>
|
||||
<PencilSquare />
|
||||
</button>
|
||||
<button class="h-9 w-9 rounded-full border border-primary p-2 text-2xl font-bold text-primary">
|
||||
<MagnifyingGlass />
|
||||
</button>
|
||||
{/* <div>column 1</div> */}
|
||||
{/* <div>column 2</div> */}
|
||||
<div class="flex w-14 flex-auto flex-col items-center gap-3 border-r border-rose-200 pt-5">
|
||||
<div class="flex flex-col items-center gap-3">
|
||||
<button
|
||||
class={`h-9 w-9 rounded-full border border-primary bg-primary p-2 text-2xl font-bold text-white`}
|
||||
onClick={() => setFormOpened((current) => !current)}
|
||||
>
|
||||
<PencilSquare />
|
||||
</button>
|
||||
<button class="h-9 w-9 rounded-full border border-primary p-2 text-2xl font-bold text-primary">
|
||||
<MagnifyingGlass />
|
||||
</button>
|
||||
{/* <div>column 1</div> */}
|
||||
{/* <div>column 2</div> */}
|
||||
</div>
|
||||
<div class="grow" />
|
||||
<div>
|
||||
<button
|
||||
class="h-12 w-12 p-3 text-primary"
|
||||
onClick={() => setConfigOpened((current) => !current)}
|
||||
>
|
||||
<Cog6Tooth />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<Show when={formOpened()}>
|
||||
<NotePostForm ref={formTextAreaRef} onPost={handlePost} onClose={closeForm} />
|
||||
</Show>
|
||||
<Show when={configOpened()}>
|
||||
<Config onClose={() => setConfigOpened(false)} />
|
||||
</Show>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user