From 56758999537ca0790837f446984379eebca3a44d Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Sat, 18 Apr 2026 14:07:20 +0800 Subject: chore: modify chart --- src/components/shared/FeatherIcons.ts | 91 ++++++++----------- src/components/shared/ThemeSwitcher.tsx | 150 ++++++++++++++++---------------- 2 files changed, 112 insertions(+), 129 deletions(-) (limited to 'src/components/shared') diff --git a/src/components/shared/FeatherIcons.ts b/src/components/shared/FeatherIcons.ts index 745baa1..ee1f410 100644 --- a/src/components/shared/FeatherIcons.ts +++ b/src/components/shared/FeatherIcons.ts @@ -1,53 +1,38 @@ -import * as React from 'react'; -import * as Feather from 'react-feather'; - -type FeatherCompatProps = { - color?: string; - size?: string | number; - className?: string; - style?: React.CSSProperties; - [key: string]: unknown; -}; - -type IconComponent = React.ComponentType; - -function asIcon(name: keyof typeof Feather): IconComponent { - return Feather[name] as unknown as IconComponent; -} - -export const Activity = asIcon('Activity'); -export const ArrowDown = asIcon('ArrowDown'); -export const ArrowDownCircle = asIcon('ArrowDownCircle'); -export const ArrowUp = asIcon('ArrowUp'); -export const ChevronDown = asIcon('ChevronDown'); -export const ChevronUp = asIcon('ChevronUp'); -export const Cpu = asIcon('Cpu'); -export const Database = asIcon('Database'); -export const Download = asIcon('Download'); -export const DownloadCloud = asIcon('DownloadCloud'); -export const Eye = asIcon('Eye'); -export const EyeOff = asIcon('EyeOff'); -export const FileText = asIcon('FileText'); -export const GitHub = asIcon('GitHub'); -export const Globe = asIcon('Globe'); -export const Hash = asIcon('Hash'); -export const Info = asIcon('Info'); -export const Link = asIcon('Link'); -export const LogOut = asIcon('LogOut'); -export const Menu = asIcon('Menu'); -export const Monitor = asIcon('Monitor'); -export const Pause = asIcon('Pause'); -export const Play = asIcon('Play'); -export const RefreshCcw = asIcon('RefreshCcw'); -export const RefreshCw = asIcon('RefreshCw'); -export const RotateCw = asIcon('RotateCw'); -export const Settings = asIcon('Settings'); -export const Shield = asIcon('Shield'); -export const Sliders = asIcon('Sliders'); -export const Tag = asIcon('Tag'); -export const Tool = asIcon('Tool'); -export const Trash2 = asIcon('Trash2'); -export const Upload = asIcon('Upload'); -export const X = asIcon('X'); -export const XCircle = asIcon('XCircle'); -export const Zap = asIcon('Zap'); +export { + Activity, + ArrowDown, + ArrowDownCircle, + ArrowUp, + ChevronDown, + ChevronUp, + Cpu, + Database, + Download, + DownloadCloud, + Eye, + EyeOff, + FileText, + GitHub, + Globe, + Hash, + Info, + Link, + LogOut, + Menu, + Monitor, + Pause, + Play, + RefreshCcw, + RefreshCw, + RotateCw, + Settings, + Shield, + Sliders, + Tag, + Tool, + Trash2, + Upload, + X, + XCircle, + Zap, +} from 'react-feather'; diff --git a/src/components/shared/ThemeSwitcher.tsx b/src/components/shared/ThemeSwitcher.tsx index 363d422..dfe248d 100644 --- a/src/components/shared/ThemeSwitcher.tsx +++ b/src/components/shared/ThemeSwitcher.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { connect } from '~/components/StateProvider'; -import { framerMotionResouce } from '~/misc/motion'; +import { LazyMotion, domAnimation, m } from 'framer-motion'; import { getTheme, switchTheme } from '~/store/app'; import { State } from '~/store/types'; @@ -28,7 +28,7 @@ export function ThemeSwitcherImpl({ theme, dispatch }) { const onChange = React.useCallback( (e: React.ChangeEvent) => dispatch(switchTheme(e.target.value)), - [dispatch] + [dispatch], ); return ( @@ -46,91 +46,89 @@ export function ThemeSwitcherImpl({ theme, dispatch }) { } function MoonA() { - const module = framerMotionResouce.read(); - const motion = module.motion; return ( - - - + + + + + ); } function Sun() { - const module = framerMotionResouce.read(); - const motion = module.motion; - return ( - - - - - - - - - - - - - + + + + + + + + + + + + + + + ); } function Auto() { - const module = framerMotionResouce.read(); - const motion = module.motion; - return ( - - - - - - - + + + + + + + + + ); } -- cgit v1.3.1