Skip to content

Commit

Permalink
feat: yahhhhhhhhoooooooooooooooo!
Browse files Browse the repository at this point in the history
I guess nested buttons aren't a thing in HTML :)
  • Loading branch information
lishaduck committed Mar 17, 2024
1 parent 521c7e6 commit 2319bc9
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/islands/Chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@ import { IconMessageChatbot } from "../utils/icons.ts";
import { tw } from "../utils/tailwind.ts";

export function Chatbot(
props: RenderableProps<JSX.HTMLAttributes<HTMLButtonElement>>,
props: RenderableProps<JSX.HTMLAttributes<HTMLDivElement>>,
): JSX.Element {
const isOpen = useSignal(false);

return (
<button
{...props}
class={`flex size-14 flex-row items-center justify-center rounded-full bg-blue-400 dark:bg-blue-800 ${props.class}`}
type="button"
onClick={() => {
isOpen.value = !isOpen.value;
}}
>
<IconMessageChatbot class="size-8" />
<div {...props} class={props.class}>
<button
class="flex size-14 flex-row items-center justify-center rounded-full bg-blue-400 dark:bg-blue-800"
onClick={() => {
isOpen.value = !isOpen.value;
}}
type="button"
aria-label="Meet our Chatbot!"
>
<IconMessageChatbot class="size-8" />
</button>
<Transition
appear={true}
show={isOpen.value}
Expand All @@ -35,7 +37,7 @@ export function Chatbot(
>
{isOpen.value && <ChatbotBox class="absolute bottom-20 right-0" />}
</Transition>
</button>
</div>
);
}

Expand Down

0 comments on commit 2319bc9

Please sign in to comment.