Skip to content

Commit

Permalink
Fix data-state errors
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Oct 25, 2024
1 parent 418a989 commit 852e977
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import dynamic from "next/dynamic";
import Link from "next/link";
import { ThemeToggle } from "@/components/ThemeToggle";

const ThemeToggle = dynamic(
async () => (await import("@/components/ThemeToggle")).ThemeToggle,
{
ssr: false,
},
);

export default function Footer() {
return (
Expand Down
9 changes: 8 additions & 1 deletion components/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ReactNode } from "react";
import { useAuthActions } from "@convex-dev/auth/react";
import { PersonIcon } from "@radix-ui/react-icons";
import { ThemeToggle } from "@/components/ThemeToggle";
import dynamic from "next/dynamic";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
Expand All @@ -14,6 +14,13 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";

const ThemeToggle = dynamic(
async () => (await import("@/components/ThemeToggle")).ThemeToggle,
{
ssr: false,
},
);

export function UserMenu({ children }: { children: ReactNode }) {
return (
<div className="flex items-center gap-2 text-sm font-medium">
Expand Down

0 comments on commit 852e977

Please sign in to comment.