Fork of atp.tools as a universal profile for people on the ATmosphere

Fix some lint issues

+18 -37
+1 -7
src/components/repoIcons.tsx
··· 9 9 Waves, 10 10 } from "lucide-react"; 11 11 12 - import { 13 - siBluesky, 14 - siLinkfire, 15 - siMediafire, 16 - SimpleIcon, 17 - siReddit, 18 - } from "simple-icons"; 12 + import { siBluesky, siMediafire, siReddit } from "simple-icons"; 19 13 20 14 interface IconMapping { 21 15 // The icon to display, a url to an image or a component (Lucide icon)
-13
src/components/themeSwitcher.tsx
··· 4 4 import { IconButton } from "./ui/iconButton"; 5 5 import { Circle, Moon, Sun } from "lucide-react"; 6 6 7 - const other = (theme: string) => { 8 - if (theme === "dark") { 9 - return "light"; 10 - } else { 11 - if (theme === "system") { 12 - const systemTheme = window.matchMedia("(prefers-color-scheme: dark)"); 13 - return systemTheme.matches ? "light" : "dark"; 14 - } else { 15 - return "dark"; 16 - } 17 - } 18 - }; 19 - 20 7 export const ColorToggle = () => { 21 8 const { theme, toggleTheme } = useTheme(); 22 9 const [mounted, setMounted] = useState(false);
+14 -14
src/components/ui/button.tsx
··· 1 - import * as React from "react" 2 - import { Slot } from "@radix-ui/react-slot" 3 - import { cva, type VariantProps } from "class-variance-authority" 1 + import * as React from "react"; 2 + import { Slot } from "@radix-ui/react-slot"; 3 + import { cva, type VariantProps } from "class-variance-authority"; 4 4 5 - import { cn } from "@/lib/utils" 5 + import { cn } from "@/lib/utils"; 6 6 7 7 const buttonVariants = cva( 8 8 "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", ··· 30 30 variant: "default", 31 31 size: "default", 32 32 }, 33 - } 34 - ) 33 + }, 34 + ); 35 35 36 36 export interface ButtonProps 37 37 extends React.ButtonHTMLAttributes<HTMLButtonElement>, 38 38 VariantProps<typeof buttonVariants> { 39 - asChild?: boolean 39 + asChild?: boolean; 40 40 } 41 41 42 42 const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( 43 43 ({ className, variant, size, asChild = false, ...props }, ref) => { 44 - const Comp = asChild ? Slot : "button" 44 + const Comp = asChild ? Slot : "button"; 45 45 return ( 46 46 <Comp 47 47 className={cn(buttonVariants({ variant, size, className }))} 48 - ref={ref} 48 + ref={ref as any} 49 49 {...props} 50 50 /> 51 - ) 52 - } 53 - ) 54 - Button.displayName = "Button" 51 + ); 52 + }, 53 + ); 54 + Button.displayName = "Button"; 55 55 56 - export { Button, buttonVariants } 56 + export { Button, buttonVariants };
+3 -3
src/components/ui/iconButton.tsx
··· 1 1 import clsx from "clsx"; 2 - import { IconType } from "react-icons/lib"; 3 2 interface IconButtonProps extends React.HTMLAttributes<HTMLButtonElement> { 4 3 className?: string; 5 - Icon: IconType; 4 + Icon: React.ReactNode; 6 5 onClick?: () => void; 7 6 ariaLabel?: string; 8 7 disabled?: boolean; 9 8 } 10 9 11 10 export const IconButton = (props: IconButtonProps) => { 11 + const Icon = props.Icon; 12 12 return ( 13 13 // tailwindcss button 14 14 <button ··· 21 21 onClick={props.onClick} 22 22 aria-label={props.ariaLabel} 23 23 > 24 - <props.Icon /> 24 + {Icon} 25 25 </button> 26 26 ); 27 27 };