Skip to content

Commit

Permalink
remove useThemeAnimation
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Oct 9, 2024
1 parent 1f41960 commit 7c822ec
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 136 deletions.
129 changes: 0 additions & 129 deletions .dumi/hooks/useThemeAnimation.ts

This file was deleted.

8 changes: 1 addition & 7 deletions .dumi/theme/common/ThemeSwitch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { CompactTheme, DarkTheme } from 'antd-token-previewer/es/icons';
import { FormattedMessage, useLocation } from 'dumi';
import React from 'react';

import useThemeAnimation from '../../../hooks/useThemeAnimation';
import { getLocalizedPathname, isZhCN } from '../../utils';
import Link from '../Link';
import ThemeIcon from './ThemeIcon';
Expand All @@ -24,8 +23,6 @@ const ThemeSwitch: React.FC<ThemeSwitchProps> = (props) => {
// const isMotionOff = value.includes('motion-off');
const isDark = value.includes('dark');

const toggleAnimationTheme = useThemeAnimation();

return (
<FloatButton.Group
trigger="click"
Expand All @@ -45,10 +42,7 @@ const ThemeSwitch: React.FC<ThemeSwitchProps> = (props) => {
<FloatButton
icon={<DarkTheme />}
type={isDark ? 'primary' : 'default'}
onClick={(e) => {
// Toggle animation when switch theme
toggleAnimationTheme(e, isDark);

onClick={() => {
if (isDark) {
onChange(value.filter((theme) => theme !== 'dark'));
} else {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"@ant-design/tools": "^18.0.2",
"@biomejs/biome": "^1.9.0",
"@codesandbox/sandpack-react": "^2.19.8",
"@emotion/server": "^11.11.0",
"@happy-dom/jest-environment": "^15.7.4",
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@madccc/duplicate-package-checker-webpack-plugin": "^1.0.0",
Expand Down

0 comments on commit 7c822ec

Please sign in to comment.