Browse Source

refactor: replace classnames with clsx

pull/11619/head
JiaxiangZhang 2 months ago
parent
commit
1498b93946
  1. 2
      package.json
  2. 26344
      pnpm-lock.yaml
  3. 10
      src/components/HeaderDropdown/index.tsx

2
package.json

@ -39,7 +39,7 @@
"@ant-design/pro-components": "^2.8.9",
"antd": "^6.0.0",
"antd-style": "^3.7.0",
"classnames": "^2.5.1",
"clsx": "^2.1.1",
"dayjs": "^1.11.13",
"react": "^19.1.0",
"react-dom": "^19.1.0"

26344
pnpm-lock.yaml

File diff suppressed because it is too large

10
src/components/HeaderDropdown/index.tsx

@ -1,7 +1,7 @@
import { Dropdown } from 'antd';
import type { DropDownProps } from 'antd/es/dropdown';
import { createStyles } from 'antd-style';
import classNames from 'classnames';
import { clsx } from 'clsx';
import React from 'react';
const useStyles = createStyles(({ token }) => {
@ -15,7 +15,7 @@ const useStyles = createStyles(({ token }) => {
});
export type HeaderDropdownProps = {
overlayClassName?: string;
rootClassName?: string;
placement?:
| 'bottomLeft'
| 'bottomRight'
@ -26,13 +26,15 @@ export type HeaderDropdownProps = {
} & Omit<DropDownProps, 'overlay'>;
const HeaderDropdown: React.FC<HeaderDropdownProps> = ({
overlayClassName: cls,
rootClassName: cls,
...restProps
}) => {
const { styles } = useStyles();
return (
<Dropdown
overlayClassName={classNames(styles.dropdown, cls)}
classNames={{
root: clsx(styles.dropdown, cls),
}}
{...restProps}
/>
);

Loading…
Cancel
Save