Skip to content

Commit

Permalink
chore: remove unused deps
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Aug 30, 2024
1 parent b4aabea commit c8ab199
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 80 deletions.
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,13 @@
"dependencies": {
"@ant-design/icons": "^4.8.3",
"@ant-design/pro-components": "^2.7.9",
"@umijs/route-utils": "^2.2.2",
"antd": "^5.18.0",
"antd-style": "^3.6.2",
"classnames": "^2.5.1",
"omit.js": "^2.0.2",
"dayjs": "^1.11.13",
"querystring": "^0.2.1",
"rc-menu": "^9.14.0",
"rc-util": "^5.41.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet-async": "^1.3.0"
"react-dom": "^18.3.1"
},
"devDependencies": {
"@ant-design/pro-cli": "^3.3.0",
Expand Down
62 changes: 4 additions & 58 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 13 additions & 16 deletions src/components/RightContent/AvatarDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { outLogin } from '@/services/ant-design-pro/api';
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { history, useModel } from '@umijs/max';
import { Spin } from 'antd';
import type { MenuProps } from 'antd';
import { createStyles } from 'antd-style';
import { stringify } from 'querystring';
import type { MenuInfo } from 'rc-menu/lib/interface';
import React, { useCallback } from 'react';
import React from 'react';
import { flushSync } from 'react-dom';
import HeaderDropdown from '../HeaderDropdown';

Expand Down Expand Up @@ -62,20 +62,17 @@ export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu, childre

const { initialState, setInitialState } = useModel('@@initialState');

const onMenuClick = useCallback(
(event: MenuInfo) => {
const { key } = event;
if (key === 'logout') {
flushSync(() => {
setInitialState((s) => ({ ...s, currentUser: undefined }));
});
loginOut();
return;
}
history.push(`/account/${key}`);
},
[setInitialState],
);
const onMenuClick: MenuProps['onClick'] = (event) => {
const { key } = event;
if (key === 'logout') {
flushSync(() => {
setInitialState((s) => ({ ...s, currentUser: undefined }));
});
loginOut();
return;
}
history.push(`/account/${key}`);
};

const loading = (
<span className={styles.action}>
Expand Down

0 comments on commit c8ab199

Please sign in to comment.