update styling

This commit is contained in:
Chris Kruining 2024-10-23 14:02:25 +02:00
parent b817c06fd4
commit 1472bd8116
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
4 changed files with 5 additions and 6 deletions

View file

@ -3,8 +3,8 @@ import { createMemo, createSignal, ParentComponent, Show, splitProps } from "sol
import { Dynamic } from "solid-js/web";
import css from "./sidebar.module.css";
export const Sidebar: ParentComponent<{ as?: string, open?: boolean, name?: string } & Record<string, any>> = (props) => {
const [local, forwarded] = splitProps(props, ['as', 'open', 'name', 'class']);
export const Sidebar: ParentComponent<{ as?: string, open?: boolean, name?: string, label?: string } & Record<string, any>> = (props) => {
const [local, forwarded] = splitProps(props, ['as', 'open', 'name', 'class', 'label']);
const [open, setOpen] = createSignal(local.open ?? true);
const name = createMemo(() => local.name ?? 'sidebar');
@ -16,7 +16,7 @@ export const Sidebar: ParentComponent<{ as?: string, open?: boolean, name?: stri
title={`${open() ? 'close' : 'open'} ${name()}`}
>
<Show when={open()} fallback={<TbLayoutSidebarLeftExpand />}>
<TbLayoutSidebarLeftCollapse />
<TbLayoutSidebarLeftCollapse /> {local.label}
</Show>
</button>