mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
chore: reduce code by gndelia/codemod-replace-react-fc-typescript
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user