sanitize all user inputs, fix #2172

This commit is contained in:
Amruth Pillai
2025-01-24 23:53:45 +01:00
parent 308a8e3ae3
commit c7ae0e94d7
29 changed files with 190 additions and 99 deletions

View File

@ -7,9 +7,10 @@ import { useMemo } from "react";
type Props = {
size?: number;
className?: string;
};
export const ThemeSwitch = ({ size = 20 }: Props) => {
export const ThemeSwitch = ({ size = 20, className }: Props) => {
const { theme, toggleTheme } = useTheme();
const variants: Variants = useMemo(() => {
@ -21,7 +22,7 @@ export const ThemeSwitch = ({ size = 20 }: Props) => {
}, [size]);
return (
<Button size="icon" variant="ghost" onClick={toggleTheme}>
<Button size="icon" variant="ghost" className={className} onClick={toggleTheme}>
<div className="cursor-pointer overflow-hidden" style={{ width: size, height: size }}>
<motion.div animate={theme} variants={variants} className="flex">
<Sun size={size} className="shrink-0" />