mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-07 17:44:59 -05:00
fix: toggle button was broken
This commit is contained in:
parent
bd6cfe6508
commit
9cfec8deca
@ -48,7 +48,7 @@ export default function TopBar({ inter }: { inter: string }) {
|
||||
return (
|
||||
<>
|
||||
<SignedOut>
|
||||
<div className="mt-1 gap-1 grid grid-cols-5">
|
||||
<div className="mt-1 gap-1 grid grid-cols-6">
|
||||
<SignInPopoverButton className="col-span-2" variant="outline" />
|
||||
<Button
|
||||
size="icon"
|
||||
@ -91,7 +91,7 @@ export default function TopBar({ inter }: { inter: string }) {
|
||||
</div>
|
||||
</SignedOut>
|
||||
<SignedIn>
|
||||
<div className="mt-1 grid grid-cols-4 gap-1">
|
||||
<div className="mt-1 grid grid-cols-5 gap-1">
|
||||
<Popover>
|
||||
<PopoverTrigger>
|
||||
<Button size="icon" variant="ghost" className="mb-1">
|
||||
|
||||
@ -29,19 +29,19 @@
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import { CommandEvents } from "@/lib/commandEvent";
|
||||
import { useEffectOnce } from "@/lib/useEffectOnce";
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import Snowfall from "react-snowfall";
|
||||
|
||||
export const snowfallEvents = new CommandEvents();
|
||||
export default function SnowfallController() {
|
||||
const [visible, setVisible] = useState(true);
|
||||
|
||||
useEffectOnce(() => {
|
||||
snowfallEvents.on("toggle", () => setVisible(!visible));
|
||||
});
|
||||
useEffect(() => {
|
||||
snowfallEvents.on("toggle", () => {
|
||||
setVisible(!visible);
|
||||
});
|
||||
}, [visible]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user