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:
@@ -1,6 +1,8 @@
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { useRouter } from "@tanstack/react-router";
|
||||
|
||||
import { isTheme, setThemeServerFn, themeMap } from "@/utils/theme";
|
||||
|
||||
import { Combobox, type SingleComboboxProps } from "../ui/combobox";
|
||||
import { useTheme } from "./provider";
|
||||
|
||||
@@ -21,7 +23,7 @@ export function ThemeCombobox(props: Props) {
|
||||
if (!value || !isTheme(value)) return;
|
||||
await setThemeServerFn({ data: value });
|
||||
setTheme(value);
|
||||
router.invalidate();
|
||||
void router.invalidate();
|
||||
};
|
||||
|
||||
return <Combobox {...props} showClear={false} options={options} defaultValue={theme} onValueChange={onThemeChange} />;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useRouter } from "@tanstack/react-router";
|
||||
import { createContext, type PropsWithChildren, use } from "react";
|
||||
|
||||
import { setThemeServerFn, type Theme } from "@/utils/theme";
|
||||
|
||||
type ThemeContextValue = {
|
||||
@@ -20,7 +21,7 @@ export function ThemeProvider({ children, theme }: Props) {
|
||||
|
||||
document.documentElement.classList.toggle("dark", value === "dark");
|
||||
await setThemeServerFn({ data: value });
|
||||
router.invalidate();
|
||||
void router.invalidate();
|
||||
|
||||
if (!playSound) return;
|
||||
|
||||
@@ -34,7 +35,7 @@ export function ThemeProvider({ children, theme }: Props) {
|
||||
}
|
||||
|
||||
function toggleTheme(options: { playSound?: boolean } = {}) {
|
||||
setTheme(theme === "dark" ? "light" : "dark", options);
|
||||
void setTheme(theme === "dark" ? "light" : "dark", options);
|
||||
}
|
||||
|
||||
return <ThemeContext value={{ theme, setTheme, toggleTheme }}>{children}</ThemeContext>;
|
||||
|
||||
@@ -2,7 +2,9 @@ import { t } from "@lingui/core/macro";
|
||||
import { MoonIcon, SunIcon } from "@phosphor-icons/react";
|
||||
import { useCallback, useRef } from "react";
|
||||
import { flushSync } from "react-dom";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
import { useTheme } from "./provider";
|
||||
|
||||
export function ThemeToggleButton(props: React.ComponentProps<typeof Button>) {
|
||||
|
||||
Reference in New Issue
Block a user