mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-25 09:24:54 +10:00
Migrate from Biome to Oxlint/Oxfmt (#2822)
* Migrate from Biome to Oxlint/Oxfmt * pin version of autofix * set version of autofix * pin version of autofix * [autofix.ci] apply automated fixes * better comments, test formatter * [autofix.ci] apply automated fixes * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,9 @@ import { Trans } from "@lingui/react/macro";
|
||||
import { PaletteIcon, SignOutIcon, TranslateIcon } from "@phosphor-icons/react";
|
||||
import { useRouter } from "@tanstack/react-router";
|
||||
import { toast } from "sonner";
|
||||
|
||||
import type { AuthSession } from "@/integrations/auth/types";
|
||||
|
||||
import { useTheme } from "@/components/theme/provider";
|
||||
import {
|
||||
DropdownMenu,
|
||||
@@ -19,7 +22,6 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { authClient } from "@/integrations/auth/client";
|
||||
import type { AuthSession } from "@/integrations/auth/types";
|
||||
import { isLocale, loadLocale, localeMap, setLocaleServerFn } from "@/utils/locale";
|
||||
import { isTheme } from "@/utils/theme";
|
||||
|
||||
@@ -33,32 +35,32 @@ export function UserDropdownMenu({ children }: Props) {
|
||||
const { theme, setTheme } = useTheme();
|
||||
const { data: session } = authClient.useSession();
|
||||
|
||||
function handleThemeChange(value: string) {
|
||||
const handleThemeChange = (value: string) => {
|
||||
if (!isTheme(value)) return;
|
||||
setTheme(value);
|
||||
}
|
||||
};
|
||||
|
||||
async function handleLocaleChange(value: string) {
|
||||
const handleLocaleChange = async (value: string) => {
|
||||
if (!isLocale(value)) return;
|
||||
await Promise.all([loadLocale(value), setLocaleServerFn({ data: value })]);
|
||||
window.location.reload();
|
||||
}
|
||||
};
|
||||
|
||||
function handleLogout() {
|
||||
const handleLogout = async () => {
|
||||
const toastId = toast.loading(t`Signing out...`);
|
||||
|
||||
authClient.signOut({
|
||||
await authClient.signOut({
|
||||
fetchOptions: {
|
||||
onSuccess: () => {
|
||||
toast.dismiss(toastId);
|
||||
router.invalidate();
|
||||
void router.invalidate();
|
||||
},
|
||||
onError: ({ error }) => {
|
||||
toast.error(error.message, { id: toastId });
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
if (!session?.user) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user