Allow plugins to specify all props for create comment. (#26152)

* Allow plugins to specificy all props for create comment.

* Types
Этот коммит содержится в:
Christopher Speller
2024-02-14 07:46:12 -08:00
коммит произвёл GitHub
родитель 28cb8d0441
Коммит 5758f234e5
3 изменённых файлов: 20 добавлений и 21 удалений

Просмотреть файл

@@ -4,30 +4,25 @@
import React from 'react';
import AdvancedCreateComment from 'components/advanced_create_comment';
import type {Props} from 'components/advanced_create_comment/advanced_create_comment';
import type {PostDraft} from 'types/store/draft';
type Props = {
placeholder?: string;
onSubmit: (draft: PostDraft) => void;
}
const ExportedCreatePost = ({placeholder, onSubmit}: Props) => {
const ExportedCreatePost = (props: Partial<Props>) => {
const Component = AdvancedCreateComment as any;
return (
<Component
placeholder={placeholder}
placeholder={''}
rootDeleted={false}
channelId={undefined}
rootId={undefined}
latestPostId={undefined}
onSubmit={onSubmit}
onUpdateCommentDraft={() => null}
updateCommentDraftWithRootId={() => null}
onMoveHistoryIndexBack={() => null}
onMoveHistoryIndexForward={() => null}
onEditLatestPost={() => ({data: true})}
isPlugin={true}
{...props}
/>
);
};