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