mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
chore: remove residual FC and FunctionComponent from components
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type {
|
||||
FC,
|
||||
MouseEventHandler,
|
||||
CSSProperties,
|
||||
PropsWithChildren,
|
||||
|
||||
@@ -41,7 +41,7 @@ type ListButtonProps = {
|
||||
content?: string;
|
||||
children?: () => JSX.Element;
|
||||
hover?: boolean;
|
||||
icon?: React.FC<SvgIconProps>;
|
||||
icon?: (prop: SvgIconProps) => JSX.Element;
|
||||
};
|
||||
|
||||
export const ListButton = (props: ListButtonProps) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FC, ReactNode, CSSProperties } from 'react';
|
||||
import type { ReactNode, CSSProperties } from 'react';
|
||||
import { styled } from '../styled';
|
||||
import { MuiDivider } from '../mui';
|
||||
import type { MuiDividerProps } from '../mui';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FC, PropsWithChildren, CSSProperties } from 'react';
|
||||
import type { PropsWithChildren, CSSProperties } from 'react';
|
||||
import { Clickable } from '../clickable';
|
||||
import { styled } from '../styled';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback } from 'react';
|
||||
import { styled } from '../styled';
|
||||
import type { FC, CSSProperties, ChangeEvent } from 'react';
|
||||
import type { CSSProperties, ChangeEvent } from 'react';
|
||||
|
||||
/**
|
||||
* WARNING: This component is about to be deprecated, use Select replace
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { FC } from 'react';
|
||||
import { SliderUnstyled, sliderUnstyledClasses } from '@mui/base';
|
||||
import type { SliderUnstyledProps } from '@mui/base';
|
||||
import { alpha } from '@mui/system';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type {
|
||||
FC,
|
||||
ChangeEventHandler,
|
||||
PropsWithChildren,
|
||||
CSSProperties,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FC, PropsWithChildren, ReactNode } from 'react';
|
||||
import type { PropsWithChildren, ReactNode } from 'react';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import {
|
||||
createTheme,
|
||||
@@ -30,8 +30,8 @@ export const ThemeProvider = ({ children }: { children?: ReactNode }) => {
|
||||
export const useTheme = () => muiUseTheme();
|
||||
|
||||
export const withTheme = <T,>(
|
||||
Component: FC<T & { theme: MuiTheme }>
|
||||
): FC<T> => {
|
||||
Component: (prop: T & { theme: MuiTheme }) => JSX.Element
|
||||
): ((prop: T) => JSX.Element) => {
|
||||
return props => {
|
||||
const theme = useTheme();
|
||||
return <Component {...props} theme={theme} />;
|
||||
|
||||
Reference in New Issue
Block a user