Add back vc auth temporarily to unblock things

This commit is contained in:
Jared Palmer 2023-05-19 14:13:38 -04:00
parent 07c2e7d36a
commit 177b2cc210
20 changed files with 350 additions and 40 deletions

View file

@ -4,16 +4,21 @@ import { useTheme } from "next-themes";
import { Button } from "@/components/ui/button";
import { Moon, Sun } from "lucide-react";
import { useTransition } from "react";
export function ThemeToggle() {
const { setTheme, theme } = useTheme();
const [_, startTransition] = useTransition();
return (
<Button
variant="ghost"
size="xs"
className="p-0 leading-4 h-4 font-normal w-full"
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
onClick={() => {
startTransition(() => {
setTheme(theme === "light" ? "dark" : "light");
});
}}
>
<span className="flex flex-row justify-between text-xs text-zinc-900 dark:text-zinc-400 w-full">
<span className="">Toggle theme</span>

View file

@ -1,6 +1,6 @@
"use client";
import { ThemeToggle } from "@/components/theme-toggle";
import { type Session } from "next-auth";
import { type Session } from "@/lib/session/types";
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import Image from "next/image";
@ -14,12 +14,12 @@ export function UserMenu({ session }: UserMenuProps) {
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
<button className="focus:outline-none">
{session.user?.image ? (
{session.user?.avatar ? (
<Image
width={24}
height={24}
className="h-6 w-6 rounded-full select-none ring-zinc-100/10 ring-1 hover:opacity-80 transition-opacity duration-300"
src={session.user?.image ? `${session.user.image}&s=60` : ""}
src={session.user?.avatar ? `${session.user.avatar}&s=60` : ""}
alt={session.user.name ?? "Avatar"}
/>
) : (