mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 17:16:16 +08:00
chore: remove residual FC and FunctionComponent from components
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import type { FC } from 'react';
|
||||
import {
|
||||
HeadingOneIcon,
|
||||
HeadingTwoIcon,
|
||||
@@ -40,7 +39,7 @@ type ClickItemHandler = (
|
||||
export type CommandMenuDataType = {
|
||||
type: BlockFlavorKeys;
|
||||
text: string;
|
||||
icon: FC<SvgIconProps>;
|
||||
icon: (prop: SvgIconProps) => JSX.Element;
|
||||
};
|
||||
|
||||
export const commonCommandMenuHandler: ClickItemHandler = async (
|
||||
|
||||
@@ -135,7 +135,9 @@ export const MenuDropdownItem = ({
|
||||
);
|
||||
};
|
||||
|
||||
const withStylesForIcon = (FontIconComponent: React.FC<SvgIconProps>) =>
|
||||
const withStylesForIcon = (
|
||||
FontIconComponent: (prop: SvgIconProps) => JSX.Element
|
||||
) =>
|
||||
styled(FontIconComponent, {
|
||||
shouldForwardProp: (prop: string) =>
|
||||
!['fontColor', 'fontBgColor'].includes(prop),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React, { type FC } from 'react';
|
||||
import type { SvgIconProps } from '@toeverything/components/ui';
|
||||
import type { Virgo, SelectionInfo } from '@toeverything/framework/virgo';
|
||||
import { inlineMenuNames, INLINE_MENU_UI_TYPES } from './config';
|
||||
@@ -23,7 +22,7 @@ export type ClickItemHandler = ({
|
||||
|
||||
export type IconItemType = {
|
||||
type: typeof INLINE_MENU_UI_TYPES['icon'];
|
||||
icon: FC<SvgIconProps>;
|
||||
icon: (prop: SvgIconProps) => JSX.Element;
|
||||
nameKey: InlineMenuNamesType;
|
||||
name: typeof inlineMenuNames[InlineMenuNamesType];
|
||||
onClick?: ClickItemHandler;
|
||||
@@ -32,7 +31,7 @@ export type IconItemType = {
|
||||
|
||||
export type DropdownItemType = {
|
||||
type: typeof INLINE_MENU_UI_TYPES['dropdown'];
|
||||
icon: FC<SvgIconProps>;
|
||||
icon: (prop: SvgIconProps) => JSX.Element;
|
||||
nameKey: InlineMenuNamesType;
|
||||
name: typeof inlineMenuNames[InlineMenuNamesType];
|
||||
children: IconItemType[];
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
useState,
|
||||
useEffect,
|
||||
FC,
|
||||
type MouseEvent,
|
||||
type DragEvent,
|
||||
type ReactNode,
|
||||
|
||||
Reference in New Issue
Block a user