Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore: reduce code by gndelia/codemod-replace-react-fc-typescript

DarkSky40b617c42944
diff --git a/apps/ligo-virgo/src/pages/tools/icons/Icons.tsx b/apps/ligo-virgo/src/pages/tools/icons/Icons.tsx
index a496a58676..9a3ba16830 100644
--- a/apps/ligo-virgo/src/pages/tools/icons/Icons.tsx
+++ b/apps/ligo-virgo/src/pages/tools/icons/Icons.tsx
@@ -3,7 +3,7 @@ import * as uiIcons from '@toeverything/components/icons';
import { message, styled } from '@toeverything/components/ui';
import { copy } from './copy';
-const IconBooth: FC<{ name: string; Icon: FC<any> }> = ({ name, Icon }) => {
+const IconBooth = ({ name, Icon }: { name: string; Icon: FC<any> }) => {
const on_click = () => {
copy(`<${name} />`);
message.success('Copied ~');
@@ -18,7 +18,7 @@ const IconBooth: FC<{ name: string; Icon: FC<any> }> = ({ name, Icon }) => {
const _icons = Object.entries(uiIcons).filter(([key]) => key !== 'timestamp');
-export const Icons: FC = () => {
+export const Icons = () => {
const ref = useRef<HTMLHeadingElement>(null);
return (
<Container>
diff --git a/libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx b/libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx
index 9810dcaf37..8b13982b83 100644
--- a/libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx
+++ b/libs/components/board-draw/src/components/command-panel/BorderColorConfig.tsx
@@ -34,10 +34,7 @@ const _getIconRenderColor = (shapes: TDShape[]) => {
return max[0];
};
-export const BorderColorConfig: FC<BorderColorConfigProps> = ({
- app,
- shapes,
-}) => {
+export const BorderColorConfig = ({ app, shapes }: BorderColorConfigProps) => {
const setBorderColor = (color: string) => {
app.style({ stroke: color }, getShapeIds(shapes));
};
diff --git a/libs/components/board-draw/src/components/command-panel/CommandPanel.tsx b/libs/components/board-draw/src/components/command-panel/CommandPanel.tsx
index 1e73889fb2..6c45bfc4e6 100644
--- a/libs/components/board-draw/src/components/command-panel/CommandPanel.tsx
+++ b/libs/components/board-draw/src/components/command-panel/CommandPanel.tsx
@@ -13,7 +13,7 @@ import { DeleteShapes } from './DeleteOperation';
import { Lock, Unlock } from './LockOperation';
import { FrameFillColorConfig } from './FrameFillColorConfig';
-export const CommandPanel: FC<{ app: TldrawApp }> = ({ app }) => {
+export const CommandPanel = ({ app }: { app: TldrawApp }) => {
const state = app.useStore();
const bounds = TLDR.get_selected_bounds(state);
const camera = app.useStore(
diff --git a/libs/components/board-draw/src/components/command-panel/DeleteOperation.tsx b/libs/components/board-draw/src/components/command-panel/DeleteOperation.tsx
index c93d022546..050c1e23d7 100644
--- a/libs/components/board-draw/src/components/command-panel/DeleteOperation.tsx
+++ b/libs/components/board-draw/src/components/command-panel/DeleteOperation.tsx
@@ -10,7 +10,7 @@ interface DeleteShapesProps {
shapes: TDShape[];
}
-export const DeleteShapes: FC<DeleteShapesProps> = ({ app, shapes }) => {
+export const DeleteShapes = ({ app, shapes }: DeleteShapesProps) => {
const deleteShapes = () => {
app.delete(getShapeIds(shapes));
};
diff --git a/libs/components/board-draw/src/components/command-panel/FillColorConfig.tsx b/libs/components/board-draw/src/components/command-panel/FillColorConfig.tsx
index 1c8ce36601..57c6a68d13 100644
--- a/libs/components/board-draw/src/components/command-panel/FillColorConfig.tsx
+++ b/libs/components/board-draw/src/components/command-panel/FillColorConfig.tsx
@@ -41,10 +41,7 @@ const _getIconRenderColor = (shapes: TDShape[]) => {
return max[0];
};
-export const FillColorConfig: FC<BorderColorConfigProps> = ({
- app,
- shapes,
-}) => {
+export const FillColorConfig = ({ app, shapes }: BorderColorConfigProps) => {
const theme = useTheme();
const setFillColor = (color: ColorType) => {
app.style(
diff --git a/libs/components/board-draw/src/components/command-panel/FontSizeConfig.tsx b/libs/components/board-draw/src/components/command-panel/FontSizeConfig.tsx
index 86d23a4331..dfb6252290 100644
--- a/libs/components/board-draw/src/components/command-panel/FontSizeConfig.tsx
+++ b/libs/components/board-draw/src/components/command-panel/FontSizeConfig.tsx
@@ -51,7 +51,7 @@ const _getFontSize = (shapes: TDShape[]): FontSizeStyle => {
return max[0] as unknown as FontSizeStyle;
};
-export const FontSizeConfig: FC<FontSizeConfigProps> = ({ app, shapes }) => {
+export const FontSizeConfig = ({ app, shapes }: FontSizeConfigProps) => {
const setFontSize = (size: FontSizeStyle) => {
app.style({ fontSize: size }, getShapeIds(shapes));
};
diff --git a/libs/components/board-draw/src/components/command-panel/FrameFillColorConfig.tsx b/libs/components/board-draw/src/components/command-panel/FrameFillColorConfig.tsx
index e8cbe07279..7e325a06f3 100644
--- a/libs/components/board-draw/src/components/command-panel/FrameFillColorConfig.tsx
+++ b/libs/components/board-draw/src/components/command-panel/FrameFillColorConfig.tsx
@@ -40,10 +40,10 @@ const _getIconRenderColor = (shapes: TDShape[]) => {
return max[0];
};
-export const FrameFillColorConfig: FC<BorderColorConfigProps> = ({
+export const FrameFillColorConfig = ({
app,
shapes,
-}) => {
+}: BorderColorConfigProps) => {
const theme = useTheme();
const setFillColor = (color: ColorType) => {
app.style(
diff --git a/libs/components/board-draw/src/components/command-panel/GroupOperation.tsx b/libs/components/board-draw/src/components/command-panel/GroupOperation.tsx
index 8a9b3f3ac5..6e6a0fcc93 100644
--- a/libs/components/board-draw/src/components/command-panel/GroupOperation.tsx
+++ b/libs/components/board-draw/src/components/command-panel/GroupOperation.tsx
@@ -10,7 +10,7 @@ interface GroupAndUnGroupProps {
shapes: TDShape[];
}
-export const Group: FC<GroupAndUnGroupProps> = ({ app, shapes }) => {
+export const Group = ({ app, shapes }: GroupAndUnGroupProps) => {
const group = () => {
app.group(getShapeIds(shapes));
};
@@ -23,7 +23,7 @@ export const Group: FC<GroupAndUnGroupProps> = ({ app, shapes }) => {
);
};
-export const UnGroup: FC<GroupAndUnGroupProps> = ({ app, shapes }) => {
+export const UnGroup = ({ app, shapes }: GroupAndUnGroupProps) => {
const ungroup = () => {
app.ungroup(getShapeIds(shapes));
};
diff --git a/libs/components/board-draw/src/components/command-panel/LockOperation.tsx b/libs/components/board-draw/src/components/command-panel/LockOperation.tsx
index aeb59b2cf8..c03ec01e1b 100644
--- a/libs/components/board-draw/src/components/command-panel/LockOperation.tsx
+++ b/libs/components/board-draw/src/components/command-panel/LockOperation.tsx
@@ -10,7 +10,7 @@ interface GroupAndUnGroupProps {
shapes: TDShape[];
}
-export const Lock: FC<GroupAndUnGroupProps> = ({ app, shapes }) => {
+export const Lock = ({ app, shapes }: GroupAndUnGroupProps) => {
const lock = () => {
app.lock(getShapeIds(shapes));
};
@@ -23,7 +23,7 @@ export const Lock: FC<GroupAndUnGroupProps> = ({ app, shapes }) => {
);
};
-export const Unlock: FC<GroupAndUnGroupProps> = ({ app, shapes }) => {
+export const Unlock = ({ app, shapes }: GroupAndUnGroupProps) => {
const unlock = () => {
app.unlock(getShapeIds(shapes));
};
diff --git a/libs/components/board-draw/src/components/command-panel/stroke-line-style-config/LineStyle.tsx b/libs/components/board-draw/src/components/command-panel/stroke-line-style-config/LineStyle.tsx
index ee54446d01..e68df6c280 100644
--- a/libs/components/board-draw/src/components/command-panel/stroke-line-style-config/LineStyle.tsx
+++ b/libs/components/board-draw/src/components/command-panel/stroke-line-style-config/LineStyle.tsx
@@ -44,12 +44,12 @@ interface LineStyleProps {
onStrokeWidthChange: (width: StrokeWidth) => void;
}
-export const LineStyle: FC<LineStyleProps> = ({
+export const LineStyle = ({
strokeStyle,
onStrokeStyleChange,
strokeWidth,
onStrokeWidthChange,
-}) => {
+}: LineStyleProps) => {
return (
<Container>
<Title>Stroke Style</Title>
diff --git a/libs/components/board-draw/src/components/command-panel/stroke-line-style-config/StrokeLineStyleConfig.tsx b/libs/components/board-draw/src/components/command-panel/stroke-line-style-config/StrokeLineStyleConfig.tsx
index 5a47534d53..fb9bea617c 100644
--- a/libs/components/board-draw/src/components/command-panel/stroke-line-style-config/StrokeLineStyleConfig.tsx
+++ b/libs/components/board-draw/src/components/command-panel/stroke-line-style-config/StrokeLineStyleConfig.tsx
@@ -24,10 +24,10 @@ interface BorderColorConfigProps {
shapes: TDShape[];
}
-export const StrokeLineStyleConfig: FC<BorderColorConfigProps> = ({
+export const StrokeLineStyleConfig = ({
app,
shapes,
-}) => {
+}: BorderColorConfigProps) => {
const strokeStyle = _getStrokeStyle(shapes);
const strokeWidth = _getStrokeWidth(shapes);
const setStrokeLineStyle = (style: DashStyle) => {
diff --git a/libs/components/board-draw/src/components/context-menu/context-menu.tsx b/libs/components/board-draw/src/components/context-menu/context-menu.tsx
index 82f1c37ce6..6d8bb5c007 100644
--- a/libs/components/board-draw/src/components/context-menu/context-menu.tsx
+++ b/libs/components/board-draw/src/components/context-menu/context-menu.tsx
@@ -1,5 +1,5 @@
import type { FC, ReactNode } from 'react';
-export const ContextMenu: FC<{ children: ReactNode }> = ({ children }) => {
+export const ContextMenu = ({ children }: { children: ReactNode }) => {
return <div>{children}</div>;
};
diff --git a/libs/components/board-draw/src/components/palette/Palette.tsx b/libs/components/board-draw/src/components/palette/Palette.tsx
index 34021444a4..f89decdd2b 100644
--- a/libs/components/board-draw/src/components/palette/Palette.tsx
+++ b/libs/components/board-draw/src/components/palette/Palette.tsx
@@ -26,11 +26,11 @@ const formatColors = (colors: ColorValue[]): ColorObject[] => {
});
};
-export const Palette: FC<PaletteProps> = ({
+export const Palette = ({
colors: propColors,
selected,
onSelect,
-}) => {
+}: PaletteProps) => {
const colorObjects = useMemo(() => formatColors(propColors), [propColors]);
return (
<Container>
diff --git a/libs/components/board-draw/src/components/tools-panel/LineTools.tsx b/libs/components/board-draw/src/components/tools-panel/LineTools.tsx
index 3959e36296..ea54a20145 100644
--- a/libs/components/board-draw/src/components/tools-panel/LineTools.tsx
+++ b/libs/components/board-draw/src/components/tools-panel/LineTools.tsx
@@ -33,7 +33,7 @@ const shapes = [
const activeToolSelector = (s: TDSnapshot) => s.appState.activeTool;
-export const LineTools: FC<{ app: TldrawApp }> = ({ app }) => {
+export const LineTools = ({ app }: { app: TldrawApp }) => {
const activeTool = app.useStore(activeToolSelector);
const [lastActiveTool, setLastActiveTool] = useState<ShapeTypes>(
diff --git a/libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx b/libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx
index c042d860f5..32f8a5ba9a 100644
--- a/libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx
+++ b/libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx
@@ -69,7 +69,7 @@ const shapes = [
const activeToolSelector = (s: TDSnapshot) => s.appState.activeTool;
-export const ShapeTools: FC<{ app: TldrawApp }> = ({ app }) => {
+export const ShapeTools = ({ app }: { app: TldrawApp }) => {
const activeTool = app.useStore(activeToolSelector);
const [lastActiveTool, setLastActiveTool] = useState<ShapeTypes>(
diff --git a/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx b/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx
index e8d10e1f7d..f650f8dd8c 100644
--- a/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx
+++ b/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx
@@ -68,7 +68,7 @@ const tools: Array<{
},
];
-export const ToolsPanel: FC<{ app: TldrawApp }> = ({ app }) => {
+export const ToolsPanel = ({ app }: { app: TldrawApp }) => {
const activeTool = app.useStore(activeToolSelector);
const isToolLocked = app.useStore(toolLockedSelector);
diff --git a/libs/components/board-draw/src/components/tools-panel/pen-tools/Pen.tsx b/libs/components/board-draw/src/components/tools-panel/pen-tools/Pen.tsx
index 94d83774f5..bcfc0b3bdf 100644
--- a/libs/components/board-draw/src/components/tools-panel/pen-tools/Pen.tsx
+++ b/libs/components/board-draw/src/components/tools-panel/pen-tools/Pen.tsx
@@ -9,13 +9,13 @@ interface PenProps {
onClick: () => void;
}
-export const Pen: FC<PenProps> = ({
+export const Pen = ({
name,
icon,
primaryColor,
secondaryColor,
onClick,
-}) => {
+}: PenProps) => {
return (
<Tooltip content={name}>
<StyledIconButton
diff --git a/libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx b/libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx
index f951f12697..e634ddfef3 100644
--- a/libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx
+++ b/libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx
@@ -105,7 +105,7 @@ const PENCIL_CONFIGS_MAP = PENCIL_CONFIGS.reduce<
return acc;
}, {} as Record<TDToolType, PencilConfig>);
-export const PenTools: FC<{ app: TldrawApp }> = ({ app }) => {
+export const PenTools = ({ app }: { app: TldrawApp }) => {
const appCurrentTool = app.useStore(state => state.appState.activeTool);
const chosenPen =
PENCIL_CONFIGS.find(config => config.key === appCurrentTool) ||
diff --git a/libs/components/board-draw/src/components/zoom-bar/ZoomBar.tsx b/libs/components/board-draw/src/components/zoom-bar/ZoomBar.tsx
index 9a1693031d..ba05686c80 100644
--- a/libs/components/board-draw/src/components/zoom-bar/ZoomBar.tsx
+++ b/libs/components/board-draw/src/components/zoom-bar/ZoomBar.tsx
@@ -16,7 +16,7 @@ import { MiniMap } from './mini-map';
const zoomSelector = (s: TDSnapshot) =>
s.document.pageStates[s.appState.currentPageId].camera.zoom;
-export const ZoomBar: FC = () => {
+export const ZoomBar = () => {
const app = useTldrawApp();
const zoom = app.useStore(zoomSelector);
diff --git a/libs/components/board-draw/src/components/zoom-bar/mini-map/MiniMap.tsx b/libs/components/board-draw/src/components/zoom-bar/mini-map/MiniMap.tsx
index f3ad758434..0b950fe026 100644
--- a/libs/components/board-draw/src/components/zoom-bar/mini-map/MiniMap.tsx
+++ b/libs/components/board-draw/src/components/zoom-bar/mini-map/MiniMap.tsx
@@ -18,7 +18,7 @@ const getScaleToMap = (width: number, height: number) => {
return scaleWidth > scaleHeight ? scaleWidth : scaleHeight;
};
-export const MiniMap: FC = () => {
+export const MiniMap = () => {
const app = useTldrawApp();
const page = app.useStore(s => s.document.pages[s.appState.currentPageId]);
const pageState = app.useStore(
diff --git a/libs/components/board-draw/src/components/zoom-bar/mini-map/SimplifiedShape.tsx b/libs/components/board-draw/src/components/zoom-bar/mini-map/SimplifiedShape.tsx
index e64cf18f72..9edb3eda65 100644
--- a/libs/components/board-draw/src/components/zoom-bar/mini-map/SimplifiedShape.tsx
+++ b/libs/components/board-draw/src/components/zoom-bar/mini-map/SimplifiedShape.tsx
@@ -6,13 +6,13 @@ interface SimplifiedShapeProps extends TLBounds {
onClick?: () => void;
}
-export const SimplifiedShape: FC<SimplifiedShapeProps> = ({
+export const SimplifiedShape = ({
onClick,
width,
height,
minX,
minY,
-}) => {
+}: SimplifiedShapeProps) => {
const style: CSSProperties = {
width: `${width}px`,
height: `${height}px`,
diff --git a/libs/components/board-draw/src/components/zoom-bar/mini-map/Viewport.tsx b/libs/components/board-draw/src/components/zoom-bar/mini-map/Viewport.tsx
index de923a6afd..7cd830f16d 100644
--- a/libs/components/board-draw/src/components/zoom-bar/mini-map/Viewport.tsx
+++ b/libs/components/board-draw/src/components/zoom-bar/mini-map/Viewport.tsx
@@ -8,13 +8,13 @@ interface ViewportProps extends TLBounds {
onPan?: (delta: [number, number]) => void;
}
-export const Viewport: FC<ViewportProps> = ({
+export const Viewport = ({
onPan,
width,
height,
minX,
minY,
-}) => {
+}: ViewportProps) => {
const style: CSSProperties = {
width: `${width}px`,
height: `${height}px`,
diff --git a/libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx b/libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx
index dee9042e7a..a2ef05300c 100644
--- a/libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx
+++ b/libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx
@@ -43,7 +43,7 @@ const todoIsEmpty = (contentValue: ContentColumnValue): boolean => {
const BulletLeft = styled('div')(() => ({
height: '22px',
}));
-export const BulletView: FC<CreateView> = ({ block, editor }) => {
+export const BulletView = ({ block, editor }: CreateView) => {
// block.remove();
const properties = { ...defaultBulletProps, ...block.getProperties() };
const textRef = useRef<ExtendedTextUtils>(null);
diff --git a/libs/components/editor-blocks/src/blocks/code/CodeView.tsx b/libs/components/editor-blocks/src/blocks/code/CodeView.tsx
index 9ce542acf2..2d421296ee 100644
--- a/libs/components/editor-blocks/src/blocks/code/CodeView.tsx
+++ b/libs/components/editor-blocks/src/blocks/code/CodeView.tsx
@@ -126,7 +126,7 @@ const CodeBlock = styled('div')(({ theme }) => ({
outline: 'none !important',
},
}));
-export const CodeView: FC<CreateCodeView> = ({ block, editor }) => {
+export const CodeView = ({ block, editor }: CreateCodeView) => {
const initValue: string = block.getProperty('text')?.value?.[0]?.text;
const langType: string = block.getProperty('lang');
const [extensions, setExtensions] = useState<Extension[]>();
diff --git a/libs/components/editor-blocks/src/blocks/divider/divider-view.tsx b/libs/components/editor-blocks/src/blocks/divider/divider-view.tsx
index 7611f78f32..293fd2c4cc 100644
--- a/libs/components/editor-blocks/src/blocks/divider/divider-view.tsx
+++ b/libs/components/editor-blocks/src/blocks/divider/divider-view.tsx
@@ -18,7 +18,7 @@ const Line = styled('div')({
backgroundColor: '#e2e8f0',
});
-export const DividerView: FC<CreateView> = ({ block, editor }) => {
+export const DividerView = ({ block, editor }: CreateView) => {
const [isSelected, setIsSelected] = useState(false);
useOnSelect(block.id, (isSelect: boolean) => {
diff --git a/libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx b/libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx
index da33c2be4a..e939f3951b 100644
--- a/libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx
+++ b/libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx
@@ -13,7 +13,7 @@ const MESSAGES = {
};
type EmbedLinkView = CreateView;
-export const EmbedLinkView: FC<EmbedLinkView> = props => {
+export const EmbedLinkView = (props: EmbedLinkView) => {
const { block, editor } = props;
const [isSelect, setIsSelect] = useState(false);
diff --git a/libs/components/editor-blocks/src/blocks/figma/FigmaView.tsx b/libs/components/editor-blocks/src/blocks/figma/FigmaView.tsx
index 2d12315235..ad2bf5720a 100644
--- a/libs/components/editor-blocks/src/blocks/figma/FigmaView.tsx
+++ b/libs/components/editor-blocks/src/blocks/figma/FigmaView.tsx
@@ -16,7 +16,7 @@ const MESSAGES = {
interface FigmaView extends CreateView {
figmaUrl?: string;
}
-export const FigmaView: FC<FigmaView> = ({ block, editor }) => {
+export const FigmaView = ({ block, editor }: FigmaView) => {
const [figmaUrl, setFigmaUrl] = useState<string>(
block.getProperty('embedLink')?.value
);
diff --git a/libs/components/editor-blocks/src/blocks/file/FileView.tsx b/libs/components/editor-blocks/src/blocks/file/FileView.tsx
index 819bb5a5dc..32dfe08432 100644
--- a/libs/components/editor-blocks/src/blocks/file/FileView.tsx
+++ b/libs/components/editor-blocks/src/blocks/file/FileView.tsx
@@ -48,7 +48,7 @@ const FileViewContainer = styled('div')<{ isSelected: boolean }>(
};
}
);
-export const FileView: FC<FileView> = ({ block, editor }) => {
+export const FileView = ({ block, editor }: FileView) => {
const [fileUrl, setFileUrl] = useState<string>();
const fileInfo = block.getProperty('file') || ({} as FileColumnValue);
const file_id = fileInfo.value;
diff --git a/libs/components/editor-blocks/src/blocks/grid-item/GridItem.tsx b/libs/components/editor-blocks/src/blocks/grid-item/GridItem.tsx
index 4273e7c5d1..770d3792a4 100644
--- a/libs/components/editor-blocks/src/blocks/grid-item/GridItem.tsx
+++ b/libs/components/editor-blocks/src/blocks/grid-item/GridItem.tsx
@@ -7,7 +7,7 @@ import { GRID_PROPERTY_KEY, removePercent } from '../grid';
export const GRID_ITEM_CLASS_NAME = 'grid-item';
export const GRID_ITEM_CONTENT_CLASS_NAME = `${GRID_ITEM_CLASS_NAME}-content`;
-export const GridItem: FC<ChildrenView> = function (props) {
+export const GridItem = function (props: ChildrenView) {
const { children, block, editor } = props;
const RENDER_DELAY_TIME = 100;
const ref = useRef<HTMLDivElement>();
diff --git a/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx b/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx
index ee7146879f..0d945b88ef 100644
--- a/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx
+++ b/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx
@@ -3,7 +3,7 @@ import { RenderBlock } from '@toeverything/components/editor-core';
import { ChildrenView, CreateView } from '@toeverything/framework/virgo';
export const GridItemRender = function (creator: FC<ChildrenView>) {
- const GridItem: FC<CreateView> = function (props) {
+ const GridItem = function (props: CreateView) {
const { block } = props;
const children = (
<>
diff --git a/libs/components/editor-blocks/src/blocks/grid/GirdHandle.tsx b/libs/components/editor-blocks/src/blocks/grid/GirdHandle.tsx
index 687cc28735..f87e1c8995 100644
--- a/libs/components/editor-blocks/src/blocks/grid/GirdHandle.tsx
+++ b/libs/components/editor-blocks/src/blocks/grid/GirdHandle.tsx
@@ -16,7 +16,7 @@ type GridHandleProps = {
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
};
-export const GridHandle: FC<GridHandleProps> = function ({
+export const GridHandle = function ({
blockId,
editor,
enabledAddItem,
@@ -25,7 +25,7 @@ export const GridHandle: FC<GridHandleProps> = function ({
draggable,
alertHandleId,
onMouseEnter,
-}) {
+}: GridHandleProps) {
const [isMouseDown, setIsMouseDown] = useState<boolean>(false);
const handleMouseDown: React.MouseEventHandler<HTMLDivElement> = e => {
if (draggable) {
diff --git a/libs/components/editor-blocks/src/blocks/grid/Grid.tsx b/libs/components/editor-blocks/src/blocks/grid/Grid.tsx
index ec06c1049f..79ab22d0ad 100644
--- a/libs/components/editor-blocks/src/blocks/grid/Grid.tsx
+++ b/libs/components/editor-blocks/src/blocks/grid/Grid.tsx
@@ -20,7 +20,7 @@ export function removePercent(str: string) {
return str.replace('%', '');
}
-export const Grid: FC<CreateView> = function (props) {
+export const Grid = function (props: CreateView) {
const { block, editor } = props;
const gridItemMinWidth = editor.configManager.grid.gridItemMinWidth;
const [isOnDrag, setIsOnDrag] = useState<boolean>(false);
diff --git a/libs/components/editor-blocks/src/blocks/group/GroupView.tsx b/libs/components/editor-blocks/src/blocks/group/GroupView.tsx
index b990d1aa5a..9ab7dec7ca 100644
--- a/libs/components/editor-blocks/src/blocks/group/GroupView.tsx
+++ b/libs/components/editor-blocks/src/blocks/group/GroupView.tsx
@@ -78,7 +78,7 @@ const GroupContainer = styled('div')<{ isSelect?: boolean }>(
})
);
-export const GroupView: FC<CreateView> = props => {
+export const GroupView = (props: CreateView) => {
const { block, editor } = props;
const [currentView] = useCurrentView();
const [groupIsSelect, setGroupIsSelect] = useState(false);
diff --git a/libs/components/editor-blocks/src/blocks/group/ScenePage.tsx b/libs/components/editor-blocks/src/blocks/group/ScenePage.tsx
index 2ff26ba55d..ba73bcd6b7 100644
--- a/libs/components/editor-blocks/src/blocks/group/ScenePage.tsx
+++ b/libs/components/editor-blocks/src/blocks/group/ScenePage.tsx
@@ -2,6 +2,6 @@ import { RenderBlockChildren } from '@toeverything/components/editor-core';
import type { CreateView } from '@toeverything/framework/virgo';
import { FC } from 'react';
-export const ScenePage: FC<CreateView> = ({ block }) => {
+export const ScenePage = ({ block }: CreateView) => {
return <RenderBlockChildren block={block} />;
};
diff --git a/libs/components/editor-blocks/src/blocks/group/SceneTable.tsx b/libs/components/editor-blocks/src/blocks/group/SceneTable.tsx
index 6b7a56cb54..f7a3422bcf 100644
--- a/libs/components/editor-blocks/src/blocks/group/SceneTable.tsx
+++ b/libs/components/editor-blocks/src/blocks/group/SceneTable.tsx
@@ -5,7 +5,7 @@ import type { CreateView } from '@toeverything/framework/virgo';
import type { TableColumn, TableRow } from '../../components/table';
import { Table, CustomCell } from '../../components/table';
-export const SceneTable: FC<CreateView> = ({ block, columns, editor }) => {
+export const SceneTable = ({ block, columns, editor }: CreateView) => {
const [rows, set_rows] = useState<TableRow[]>([]);
const data_columns = useMemo<TableColumn[]>(() => {
return (columns || [])
diff --git a/libs/components/editor-blocks/src/blocks/groupDvider/groupDividerView.tsx b/libs/components/editor-blocks/src/blocks/groupDvider/groupDividerView.tsx
index c14d4bbf01..bb5d1f3c9c 100644
--- a/libs/components/editor-blocks/src/blocks/groupDvider/groupDividerView.tsx
+++ b/libs/components/editor-blocks/src/blocks/groupDvider/groupDividerView.tsx
@@ -1,6 +1,6 @@
import { FC } from 'react';
import { CreateView } from '@toeverything/framework/virgo';
-export const GroupDividerView: FC<CreateView> = ({ block, editor }) => {
+export const GroupDividerView = ({ block, editor }: CreateView) => {
return <></>;
};
diff --git a/libs/components/editor-blocks/src/blocks/image/ImageView.tsx b/libs/components/editor-blocks/src/blocks/image/ImageView.tsx
index 369dceac87..3a7eb0fbc7 100644
--- a/libs/components/editor-blocks/src/blocks/image/ImageView.tsx
+++ b/libs/components/editor-blocks/src/blocks/image/ImageView.tsx
@@ -54,7 +54,7 @@ const KanbanImageContainer = styled('div')<{ isSelected: boolean }>(
};
}
);
-export const ImageView: FC<ImageView> = ({ block, editor }) => {
+export const ImageView = ({ block, editor }: ImageView) => {
const workspace = editor.workspace;
const [imgUrl, set_image_url] = useState<string>();
const [imgWidth, setImgWidth] = useState<number>(0);
diff --git a/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx b/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx
index 2f8f29b706..80fd350776 100644
--- a/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx
+++ b/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx
@@ -40,7 +40,7 @@ const todoIsEmpty = (contentValue: ContentColumnValue): boolean => {
);
};
-export const NumberedView: FC<CreateView> = ({ block, editor }) => {
+export const NumberedView = ({ block, editor }: CreateView) => {
// block.remove();
const properties = { ...defaultTodoProps, ...block.getProperties() };
const [number, set_number] = useState<number>(1);
diff --git a/libs/components/editor-blocks/src/blocks/page/PageView.tsx b/libs/components/editor-blocks/src/blocks/page/PageView.tsx
index 17ad6cae9c..64ea3c9536 100644
--- a/libs/components/editor-blocks/src/blocks/page/PageView.tsx
+++ b/libs/components/editor-blocks/src/blocks/page/PageView.tsx
@@ -15,7 +15,7 @@ import {
type ExtendedTextUtils,
} from '../../components/text-manage';
-export const PageView: FC<CreateView> = ({ block, editor }) => {
+export const PageView = ({ block, editor }: CreateView) => {
const { workspace_id } = useParams();
const textRef = useRef<ExtendedTextUtils>(null);
const [backLinks, setBackLinks] =
diff --git a/libs/components/editor-blocks/src/blocks/ref-link/ref-link-view.tsx b/libs/components/editor-blocks/src/blocks/ref-link/ref-link-view.tsx
index 80e035775e..07d66175f8 100644
--- a/libs/components/editor-blocks/src/blocks/ref-link/ref-link-view.tsx
+++ b/libs/components/editor-blocks/src/blocks/ref-link/ref-link-view.tsx
@@ -5,7 +5,7 @@ import { CreateView } from '@toeverything/framework/virgo';
type RefLinkView = CreateView;
-export const RefLinkView: FC<RefLinkView> = ({ block, editor }) => {
+export const RefLinkView = ({ block, editor }: RefLinkView) => {
const page_id = useMemo(() => block.getProperty('reference'), [block]);
const [block_content, set_block] =
diff --git a/libs/components/editor-blocks/src/blocks/text/TextView.tsx b/libs/components/editor-blocks/src/blocks/text/TextView.tsx
index 2f26e17c38..5f55e6d649 100644
--- a/libs/components/editor-blocks/src/blocks/text/TextView.tsx
+++ b/libs/components/editor-blocks/src/blocks/text/TextView.tsx
@@ -51,11 +51,11 @@ const TextBlock = styled(TextManage)<{ type: string }>(({ theme, type }) => {
}
});
-export const TextView: FC<CreateTextView> = ({
+export const TextView = ({
block,
editor,
containerClassName,
-}) => {
+}: CreateTextView) => {
const [isSelect, setIsSelect] = useState<boolean>();
useOnSelect(block.id, (is_select: boolean) => {
setIsSelect(is_select);
diff --git a/libs/components/editor-blocks/src/blocks/toc/toc-view.tsx b/libs/components/editor-blocks/src/blocks/toc/toc-view.tsx
index 6e16889b21..bc1b5397b4 100644
--- a/libs/components/editor-blocks/src/blocks/toc/toc-view.tsx
+++ b/libs/components/editor-blocks/src/blocks/toc/toc-view.tsx
@@ -11,7 +11,7 @@ const INITIAL_LIST: MenuItem[] = [];
const MESSAGES = {
NO_HEADINGS_FOUND: 'No headings found',
};
-export const TocView: FC<CreateView> = ({ block, editor }) => {
+export const TocView = ({ block, editor }: CreateView) => {
const [list, setList] = useState(INITIAL_LIST);
useEffect(() => {
const sync_toc = async () => {
diff --git a/libs/components/editor-blocks/src/blocks/todo/CheckBox.tsx b/libs/components/editor-blocks/src/blocks/todo/CheckBox.tsx
index 59d0d20fb8..67641c8bb5 100644
--- a/libs/components/editor-blocks/src/blocks/todo/CheckBox.tsx
+++ b/libs/components/editor-blocks/src/blocks/todo/CheckBox.tsx
@@ -8,12 +8,12 @@ interface CheckBoxProps {
onChange: (checked: boolean) => void;
}
-export const CheckBox: FC<CheckBoxProps> = ({
+export const CheckBox = ({
size = 16,
height = 23,
checked,
onChange,
-}) => {
+}: CheckBoxProps) => {
const dynamic_style = useMemo(
() => ({
height: {
diff --git a/libs/components/editor-blocks/src/blocks/todo/TodoView.tsx b/libs/components/editor-blocks/src/blocks/todo/TodoView.tsx
index e5588d46f4..cf16857099 100644
--- a/libs/components/editor-blocks/src/blocks/todo/TodoView.tsx
+++ b/libs/components/editor-blocks/src/blocks/todo/TodoView.tsx
@@ -33,7 +33,7 @@ const todoIsEmpty = (contentValue: ContentColumnValue): boolean => {
);
};
-export const TodoView: FC<CreateView> = ({ block, editor }) => {
+export const TodoView = ({ block, editor }: CreateView) => {
const properties = { ...defaultTodoProps, ...block.getProperties() };
const text_ref = useRef<ExtendedTextUtils>(null);
diff --git a/libs/components/editor-blocks/src/blocks/youtube/YoutubeView.tsx b/libs/components/editor-blocks/src/blocks/youtube/YoutubeView.tsx
index d761e8e108..d5b385fbdf 100644
--- a/libs/components/editor-blocks/src/blocks/youtube/YoutubeView.tsx
+++ b/libs/components/editor-blocks/src/blocks/youtube/YoutubeView.tsx
@@ -10,7 +10,7 @@ const _messages = {
};
type YoutubeView = CreateView;
-export const YoutubeView: FC<YoutubeView> = ({ block }) => {
+export const YoutubeView = ({ block }: YoutubeView) => {
const [youtubeUrl, setYoutubeUrl] = useState<string>(
block.getProperty('embedLink')?.value
);
diff --git a/libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx b/libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx
index dbe12277b6..603846a5a6 100644
--- a/libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx
+++ b/libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx
@@ -7,13 +7,13 @@ type BlockContainerProps = Parameters<typeof Container>[0] & {
editor: BlockEditor;
};
-export const BlockContainer: FC<BlockContainerProps> = function ({
+export const BlockContainer = function ({
block,
children,
className,
editor,
...restProps
-}) {
+}: BlockContainerProps) {
return (
<Container
className={`${className || ''} block_container`}
diff --git a/libs/components/editor-blocks/src/components/ImageView/ImageView.tsx b/libs/components/editor-blocks/src/components/ImageView/ImageView.tsx
index 24ffac6f29..54acf2bdbe 100644
--- a/libs/components/editor-blocks/src/components/ImageView/ImageView.tsx
+++ b/libs/components/editor-blocks/src/components/ImageView/ImageView.tsx
@@ -33,7 +33,7 @@ const ImageContainer = styled('div')<{ isSelected: boolean }>(
};
}
);
-export const Image: FC<Props> = props => {
+export const Image = (props: Props) => {
const { link, viewStyle, isSelected, block } = props;
const on_resize_end = (e: any, data: any) => {
block.setProperty('image_style', data.size);
diff --git a/libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx b/libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx
index f342d28ba6..b8ff537d96 100644
--- a/libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx
+++ b/libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx
@@ -5,7 +5,7 @@ import { styled } from '@toeverything/components/ui';
/**
* Indent rendering child nodes
*/
-export const IndentWrapper: FC<PropsWithChildren> = props => {
+export const IndentWrapper = (props: PropsWithChildren) => {
return <StyledIdentWrapper>{props.children}</StyledIdentWrapper>;
};
diff --git a/libs/components/editor-blocks/src/components/editable/editable.tsx b/libs/components/editor-blocks/src/components/editable/editable.tsx
index 5354b08699..fbf80482f8 100644
--- a/libs/components/editor-blocks/src/components/editable/editable.tsx
+++ b/libs/components/editor-blocks/src/components/editable/editable.tsx
@@ -9,7 +9,7 @@ import { ErrorBoundary } from '@toeverything/utils';
// onChange: () => void;
// }
-export const Editable: FC = () => {
+export const Editable = () => {
const editor = useMemo(() => withReact(createEditor()), []);
return (
<ErrorBoundary
diff --git a/libs/components/editor-blocks/src/components/source-view/SourceView.tsx b/libs/components/editor-blocks/src/components/source-view/SourceView.tsx
index 4dbb488850..5a4488cf3f 100644
--- a/libs/components/editor-blocks/src/components/source-view/SourceView.tsx
+++ b/libs/components/editor-blocks/src/components/source-view/SourceView.tsx
@@ -156,7 +156,7 @@ const LoadingContiner = () => {
return <Loading>loading...</Loading>;
};
-export const SourceView: FC<Props> = props => {
+export const SourceView = (props: Props) => {
const { link, isSelected, block, editorElement } = props;
const src = formatUrl(link);
// let iframeShow = useLazyIframe(src, 3000, iframeContainer);
diff --git a/libs/components/editor-blocks/src/components/table/basic-table.tsx b/libs/components/editor-blocks/src/components/table/basic-table.tsx
index 61373017ac..875e560514 100644
--- a/libs/components/editor-blocks/src/components/table/basic-table.tsx
+++ b/libs/components/editor-blocks/src/components/table/basic-table.tsx
@@ -64,8 +64,13 @@ export const DEFAULT_RENDER_CELL: CustomCell = ({ value }) => {
return <span>{value ? String(value) : '--'}</span>;
};
-const Cell: FC<GridChildComponentProps<TableData>> = memo(
- ({ data, rowIndex, columnIndex, style }) => {
+const Cell = memo(
+ ({
+ data,
+ rowIndex,
+ columnIndex,
+ style,
+ }: GridChildComponentProps<TableData>) => {
const column = data.columns[columnIndex];
const row = data.rows[rowIndex];
const is_first_column = columnIndex === 0;
@@ -89,18 +94,17 @@ const Cell: FC<GridChildComponentProps<TableData>> = memo(
/>
</div>
);
- },
- areEqual
+ }
);
-export const BasicTable: FC<BasicTableProps> = ({
+export const BasicTable = ({
columns,
rows,
headerHeight = DEFAULT_ROW_HEIGHT,
rowKey,
border = true,
renderCell = DEFAULT_RENDER_CELL,
-}) => {
+}: BasicTableProps) => {
const container_ref = useRef<HTMLDivElement>();
const [table_width, set_table_width] = useState(0);
diff --git a/libs/components/editor-blocks/src/components/table/custom-cell/check-box/index.tsx b/libs/components/editor-blocks/src/components/table/custom-cell/check-box/index.tsx
index 37361f78f1..423f0cc29c 100644
--- a/libs/components/editor-blocks/src/components/table/custom-cell/check-box/index.tsx
+++ b/libs/components/editor-blocks/src/components/table/custom-cell/check-box/index.tsx
@@ -6,10 +6,10 @@ import type { CellProps } from '../types';
/**
* @deprecated
*/
-export const CheckBoxCell: FC<CellProps<BooleanColumnValue>> = ({
+export const CheckBoxCell = ({
value,
onChange,
-}) => {
+}: CellProps<BooleanColumnValue>) => {
return (
<Checkbox
checked={value?.value}
diff --git a/libs/components/editor-blocks/src/components/table/custom-cell/index.tsx b/libs/components/editor-blocks/src/components/table/custom-cell/index.tsx
index 1591dfa721..9669917564 100644
--- a/libs/components/editor-blocks/src/components/table/custom-cell/index.tsx
+++ b/libs/components/editor-blocks/src/components/table/custom-cell/index.tsx
@@ -9,7 +9,7 @@ import type { CellProps } from './types';
/**
* @deprecated
*/
-const DefaultCell: FC<CellProps> = ({ onChange, ...props }) => {
+const DefaultCell = ({ onChange, ...props }: CellProps) => {
return <DEFAULT_RENDER_CELL {...props} />;
};
@@ -33,7 +33,7 @@ interface CustomCellProps extends TableCustomCellProps<unknown> {
onChange: (data: TableCustomCellProps<unknown>) => void;
}
-export const CustomCell: FC<CustomCellProps> = props => {
+export const CustomCell = (props: CustomCellProps) => {
const View =
props.rowIndex === 0
? DefaultCell
diff --git a/libs/components/editor-blocks/src/components/table/custom-cell/select/index.tsx b/libs/components/editor-blocks/src/components/table/custom-cell/select/index.tsx
index e5175533e1..ed20999507 100644
--- a/libs/components/editor-blocks/src/components/table/custom-cell/select/index.tsx
+++ b/libs/components/editor-blocks/src/components/table/custom-cell/select/index.tsx
@@ -8,11 +8,11 @@ import type { CellProps } from '../types';
/**
* @deprecated
*/
-export const SelectCell: FC<CellProps<EnumColumnValue>> = ({
+export const SelectCell = ({
value,
column,
onChange,
-}) => {
+}: CellProps<EnumColumnValue>) => {
const options = useMemo(() => {
if (isEnumColumn(column.columnConfig)) {
return column.columnConfig.options.map(option => {
diff --git a/libs/components/editor-blocks/src/components/table/table.tsx b/libs/components/editor-blocks/src/components/table/table.tsx
index 1c65c63b52..73dd421081 100644
--- a/libs/components/editor-blocks/src/components/table/table.tsx
+++ b/libs/components/editor-blocks/src/components/table/table.tsx
@@ -6,7 +6,7 @@ interface TableProps extends BasicTableProps {
addon?: ReactNode;
}
-export const Table: FC<TableProps> = ({ addon, ...props }) => {
+export const Table = ({ addon, ...props }: TableProps) => {
return (
<div>
{addon}
diff --git a/libs/components/editor-blocks/src/components/upload/upload.tsx b/libs/components/editor-blocks/src/components/upload/upload.tsx
index 02066bd2b8..279a74f2c9 100644
--- a/libs/components/editor-blocks/src/components/upload/upload.tsx
+++ b/libs/components/editor-blocks/src/components/upload/upload.tsx
@@ -71,7 +71,7 @@ const UploadBox = styled('div')<{ isSelected: boolean }>(
);
const button_styles: SxProps = { width: '60%', fontSize: '12px' };
-export const Upload: FC<Props> = props => {
+export const Upload = (props: Props) => {
const {
fileChange,
size,
diff --git a/libs/components/editor-core/src/RenderRoot.tsx b/libs/components/editor-core/src/RenderRoot.tsx
index caa840cb39..8930160084 100644
--- a/libs/components/editor-core/src/RenderRoot.tsx
+++ b/libs/components/editor-core/src/RenderRoot.tsx
@@ -24,11 +24,11 @@ interface RenderRootProps {
const MAX_PAGE_WIDTH = 5000;
export const MIN_PAGE_WIDTH = 1480;
-export const RenderRoot: FC<PropsWithChildren<RenderRootProps>> = ({
+export const RenderRoot = ({
editor,
editorElement,
children,
-}) => {
+}: PropsWithChildren<RenderRootProps>) => {
const selectionRef = useRef<SelectionRef>(null);
const triggeredBySelect = useRef(false);
const [pageWidth, setPageWidth] = useState<number>(MIN_PAGE_WIDTH);
diff --git a/libs/components/editor-core/src/block-pendant/BlockPendantProvider.tsx b/libs/components/editor-core/src/block-pendant/BlockPendantProvider.tsx
index 70c56af04c..d9dcdd57cc 100644
--- a/libs/components/editor-core/src/block-pendant/BlockPendantProvider.tsx
+++ b/libs/components/editor-core/src/block-pendant/BlockPendantProvider.tsx
@@ -12,10 +12,10 @@ interface BlockTagProps {
block: AsyncBlock;
}
-export const BlockPendantProvider: FC<PropsWithChildren<BlockTagProps>> = ({
+export const BlockPendantProvider = ({
block,
children,
-}) => {
+}: PropsWithChildren<BlockTagProps>) => {
const triggerRef = useRef<HTMLDivElement>();
const { getProperties } = useRecastBlockMeta();
const properties = getProperties();
diff --git a/libs/components/editor-core/src/block-pendant/pendant-popover/PendantPopover.tsx b/libs/components/editor-core/src/block-pendant/pendant-popover/PendantPopover.tsx
index 9ec79d03e0..d92a2ab8b4 100644
--- a/libs/components/editor-core/src/block-pendant/pendant-popover/PendantPopover.tsx
+++ b/libs/components/editor-core/src/block-pendant/pendant-popover/PendantPopover.tsx
@@ -8,11 +8,11 @@ import {
} from '@toeverything/components/ui';
import { AddPendantPopover } from '../AddPendantPopover';
-export const PendantPopover: FC<
- {
+export const PendantPopover = (
+ props: {
block: AsyncBlock;
} & Omit<PopperProps, 'content'>
-> = props => {
+) => {
const { block, ...popoverProps } = props;
const popoverHandlerRef = useRef<PopperHandler>();
return (
diff --git a/libs/components/editor-core/src/render-block/RenderBlock.tsx b/libs/components/editor-core/src/render-block/RenderBlock.tsx
index 74f6c659cf..426b270533 100644
--- a/libs/components/editor-core/src/render-block/RenderBlock.tsx
+++ b/libs/components/editor-core/src/render-block/RenderBlock.tsx
@@ -10,10 +10,10 @@ interface RenderBlockProps {
hasContainer?: boolean;
}
-export const RenderBlock: FC<RenderBlockProps> = ({
+export const RenderBlock = ({
blockId,
hasContainer = true,
-}) => {
+}: RenderBlockProps) => {
const { editor, editorElement } = useEditor();
const { block } = useBlock(blockId);
const blockRef = useRef<HTMLDivElement>(null);
diff --git a/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx b/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx
index 23391057f2..96dc07676a 100644
--- a/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx
+++ b/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx
@@ -6,7 +6,7 @@ interface RenderChildrenProps {
block: AsyncBlock;
}
-export const RenderBlockChildren: FC<RenderChildrenProps> = ({ block }) => {
+export const RenderBlockChildren = ({ block }: RenderChildrenProps) => {
return block.childrenIds.length ? (
<>
{block.childrenIds.map(childId => {
diff --git a/libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx b/libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx
index 750490650c..f07380e0b9 100644
--- a/libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx
+++ b/libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx
@@ -128,7 +128,7 @@ function DragComponent(props: {
);
}
-export const LeftMenuDraggable: FC<LeftMenuProps> = props => {
+export const LeftMenuDraggable = (props: LeftMenuProps) => {
const { editor, blockInfo, defaultVisible, lineInfo } = props;
const [visible, setVisible] = useState(defaultVisible);
const [anchorEl, setAnchorEl] = useState<Element>();
diff --git a/libs/components/layout/src/header/EditorBoardSwitcher/StatusTrack.tsx b/libs/components/layout/src/header/EditorBoardSwitcher/StatusTrack.tsx
index 839c429daa..c4c0503ddf 100644
--- a/libs/components/layout/src/header/EditorBoardSwitcher/StatusTrack.tsx
+++ b/libs/components/layout/src/header/EditorBoardSwitcher/StatusTrack.tsx
@@ -8,7 +8,7 @@ interface StatusTrackProps {
onClick: () => void;
}
-export const StatusTrack: FC<StatusTrackProps> = ({ mode, onClick }) => {
+export const StatusTrack = ({ mode, onClick }: StatusTrackProps) => {
return (
<Container onClick={onClick}>
<StatusIcon mode={mode} />
diff --git a/libs/components/layout/src/settings-sidebar/Settings/footer/Footer.tsx b/libs/components/layout/src/settings-sidebar/Settings/footer/Footer.tsx
index 712fe2a599..ab2a976624 100644
--- a/libs/components/layout/src/settings-sidebar/Settings/footer/Footer.tsx
+++ b/libs/components/layout/src/settings-sidebar/Settings/footer/Footer.tsx
@@ -3,7 +3,7 @@ import { styled } from '@toeverything/components/ui';
import { LastModified } from './LastModified';
import { Logout } from './Logout';
-export const Footer: FC = () => {
+export const Footer = () => {
return (
<Container>
<LastModified />
diff --git a/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx b/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx
index 3bac52c47d..e7e937a90f 100644
--- a/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx
+++ b/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx
@@ -4,7 +4,7 @@ import { Typography, styled } from '@toeverything/components/ui';
import { useUserAndSpaces } from '@toeverything/datasource/state';
import { usePageLastUpdated, useWorkspaceAndPageId } from '../util';
-export const LastModified: FC = () => {
+export const LastModified = () => {
const { user } = useUserAndSpaces();
const username = user ? user.nickname : 'Anonymous';
const { workspaceId, pageId } = useWorkspaceAndPageId();
diff --git a/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx b/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx
index 361ad8475c..0acd0b3e6a 100644
--- a/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx
+++ b/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx
@@ -21,7 +21,7 @@ const logout = () => {
window.location.href = '/';
};
-export const Logout: FC = () => {
+export const Logout = () => {
return (
<ListItem onClick={logout}>
<StyledIcon />
diff --git a/libs/components/ui/src/button/IconButton.tsx b/libs/components/ui/src/button/IconButton.tsx
index 77e1f08a6e..ab66b36cfc 100644
--- a/libs/components/ui/src/button/IconButton.tsx
+++ b/libs/components/ui/src/button/IconButton.tsx
@@ -39,13 +39,13 @@ interface IconButtonProps {
hoverColor?: string;
}
-export const IconButton: FC<PropsWithChildren<IconButtonProps>> = ({
+export const IconButton = ({
children,
disabled,
onClick,
className,
...props
-}) => {
+}: PropsWithChildren<IconButtonProps>) => {
return (
<Container
{...props}
diff --git a/libs/components/ui/src/divider/Divider.tsx b/libs/components/ui/src/divider/Divider.tsx
index 62b74c4eb3..f25834bd14 100644
--- a/libs/components/ui/src/divider/Divider.tsx
+++ b/libs/components/ui/src/divider/Divider.tsx
@@ -20,11 +20,11 @@ const _textAlignMap: Record<
end: 'right',
};
-export const Divider: FC<DividerProps> = ({
+export const Divider = ({
orientation = 'horizontal',
textAlign = 'center',
children,
-}) => {
+}: DividerProps) => {
return (
<StyledMuiDivider
orientation={orientation}
diff --git a/libs/components/ui/src/list/ListItem.tsx b/libs/components/ui/src/list/ListItem.tsx
index 2aa0dbae99..9b002db372 100644
--- a/libs/components/ui/src/list/ListItem.tsx
+++ b/libs/components/ui/src/list/ListItem.tsx
@@ -9,13 +9,13 @@ interface ListItemProps {
style?: CSSProperties;
}
-export const ListItem: FC<PropsWithChildren<ListItemProps>> = ({
+export const ListItem = ({
active,
children,
onClick,
className,
style,
-}) => {
+}: PropsWithChildren<ListItemProps>) => {
return (
<Container
active={active}
diff --git a/libs/components/ui/src/select/OldSelect.tsx b/libs/components/ui/src/select/OldSelect.tsx
index 79b486ef5e..d10989a1ad 100644
--- a/libs/components/ui/src/select/OldSelect.tsx
+++ b/libs/components/ui/src/select/OldSelect.tsx
@@ -17,12 +17,7 @@ interface Props {
extraStyle?: CSSProperties;
}
-export const OldSelect: FC<Props> = ({
- value,
- options,
- onChange,
- extraStyle,
-}: Props) => {
+export const OldSelect = ({ value, options, onChange, extraStyle }: Props) => {
const onSelectChange = useCallback(
(e: ChangeEvent<HTMLSelectElement>) => {
onChange(e.target.value);
diff --git a/libs/components/ui/src/slider/Slider.tsx b/libs/components/ui/src/slider/Slider.tsx
index b9cb98bb89..2e22114e77 100644
--- a/libs/components/ui/src/slider/Slider.tsx
+++ b/libs/components/ui/src/slider/Slider.tsx
@@ -14,7 +14,7 @@ interface SliderProps {
onChange?: SliderUnstyledProps['onChange'];
}
-export const Slider: FC<SliderProps> = props => {
+export const Slider = (props: SliderProps) => {
return <StyledSlider {...props} />;
};
diff --git a/libs/components/ui/src/tag/Tag.tsx b/libs/components/ui/src/tag/Tag.tsx
index 7ef614e815..70ffc2aa7c 100644
--- a/libs/components/ui/src/tag/Tag.tsx
+++ b/libs/components/ui/src/tag/Tag.tsx
@@ -19,7 +19,7 @@ export interface TagProps {
endElement?: ReactNode;
}
-export const Tag: FC<PropsWithChildren<TagProps>> = ({
+export const Tag = ({
onClick,
style,
children,
@@ -27,7 +27,7 @@ export const Tag: FC<PropsWithChildren<TagProps>> = ({
onClose,
startElement,
endElement,
-}) => {
+}: PropsWithChildren<TagProps>) => {
return (
<StyledTag
className={`affine-tag ${closeable ? 'affine-tag--closeable' : ''}`}
diff --git a/libs/components/ui/src/theme/utils.tsx b/libs/components/ui/src/theme/utils.tsx
index 35d6148e58..5bccadf10b 100644
--- a/libs/components/ui/src/theme/utils.tsx
+++ b/libs/components/ui/src/theme/utils.tsx
@@ -23,7 +23,7 @@ const theme = createTheme({
affine: Theme,
});
-export const ThemeProvider: FC<{ children?: ReactNode }> = ({ children }) => {
+export const ThemeProvider = ({ children }: { children?: ReactNode }) => {
return <MuiThemeProvider theme={theme}>{children}</MuiThemeProvider>;
};