From db6ec5717f3e1d19eba6093e12859c30218988b0 Mon Sep 17 00:00:00 2001 From: rdmclin2 Date: Mon, 24 Jul 2023 16:20:57 +0800 Subject: [PATCH] :recycle: fix: field icon style --- src/FieldIcon/style.ts | 5 ++--- src/FieldSelect/style.ts | 4 ++-- src/FieldTitle/style.ts | 4 ++-- src/IconPicker/components/IconList/IconThumbnail.tsx | 2 +- src/IconPicker/components/IconList/index.tsx | 2 +- src/LevaPanel/index.tsx | 2 +- src/SortableTree/components/TreeItem/index.tsx | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/FieldIcon/style.ts b/src/FieldIcon/style.ts index 3221d017..17b84bba 100644 --- a/src/FieldIcon/style.ts +++ b/src/FieldIcon/style.ts @@ -1,7 +1,6 @@ -import { createStyles, css, cx } from '@ant-design/pro-editor'; +import { createStyles } from '../theme'; -export const useStyle = createStyles((_, prefixCls: string) => { - const { token } = _; +export const useStyle = createStyles(({ css, cx, token }, prefixCls: string) => { return { icon: cx( `${prefixCls}`, diff --git a/src/FieldSelect/style.ts b/src/FieldSelect/style.ts index c82dddd3..e4e6427f 100644 --- a/src/FieldSelect/style.ts +++ b/src/FieldSelect/style.ts @@ -1,6 +1,6 @@ -import { createStyles, css, cx } from '@ant-design/pro-editor'; +import { createStyles } from '../theme'; -export const useStyle = createStyles(({ token }, prefixCls: string) => { +export const useStyle = createStyles(({ token, css, cx }, prefixCls: string) => { return { select: cx( `${prefixCls}`, diff --git a/src/FieldTitle/style.ts b/src/FieldTitle/style.ts index 76a63dcb..f3d5d005 100644 --- a/src/FieldTitle/style.ts +++ b/src/FieldTitle/style.ts @@ -1,6 +1,6 @@ -import { createStyles, css, cx } from '@ant-design/pro-editor'; +import { createStyles } from '../theme'; -export const useStyle = createStyles(({ token }, { prefixCls, checkable }) => { +export const useStyle = createStyles(({ token, css, cx }, { prefixCls, checkable }) => { return { content: cx( `${prefixCls}-content`, diff --git a/src/IconPicker/components/IconList/IconThumbnail.tsx b/src/IconPicker/components/IconList/IconThumbnail.tsx index b0dc71f4..4b43c48d 100644 --- a/src/IconPicker/components/IconList/IconThumbnail.tsx +++ b/src/IconPicker/components/IconList/IconThumbnail.tsx @@ -1,7 +1,7 @@ -import { createStyles } from 'antd-style'; import type { FC } from 'react'; import { memo } from 'react'; import { Flexbox } from 'react-layout-kit'; +import { createStyles } from '../../../theme'; import type { IconUnit } from '../../types'; import IconItem from '../../features/IconRender'; diff --git a/src/IconPicker/components/IconList/index.tsx b/src/IconPicker/components/IconList/index.tsx index aff7d049..bc607152 100644 --- a/src/IconPicker/components/IconList/index.tsx +++ b/src/IconPicker/components/IconList/index.tsx @@ -1,6 +1,6 @@ -import { createStyles } from 'antd-style'; import type { FC } from 'react'; import { memo } from 'react'; +import { createStyles } from '../../../theme'; import { useStore } from '../../store'; import IconThumbnail from './IconThumbnail'; diff --git a/src/LevaPanel/index.tsx b/src/LevaPanel/index.tsx index 96d62a23..35fd907e 100644 --- a/src/LevaPanel/index.tsx +++ b/src/LevaPanel/index.tsx @@ -1,6 +1,6 @@ -import { createStyles } from 'antd-style'; import { LevaPanel, LevaStoreProvider, useCreateStore } from 'leva'; import { CSSProperties, ReactNode, memo } from 'react'; +import { createStyles } from '../theme'; import Schema, { SchemaProps } from './Schema'; const useStyles = createStyles( diff --git a/src/SortableTree/components/TreeItem/index.tsx b/src/SortableTree/components/TreeItem/index.tsx index 3fb8ef87..cba891a8 100644 --- a/src/SortableTree/components/TreeItem/index.tsx +++ b/src/SortableTree/components/TreeItem/index.tsx @@ -2,10 +2,10 @@ import type { UniqueIdentifier } from '@dnd-kit/core'; import { AnimateLayoutChanges, useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; import { useClickAway } from 'ahooks'; -import { createStyles } from 'antd-style'; import type { CSSProperties, FC, HTMLAttributes } from 'react'; import { memo, useRef } from 'react'; import { shallow } from 'zustand/shallow'; +import { createStyles } from '../../../theme'; import { CollapseAction, DeleteAction, HandleAction } from '@/ActionIcon';