Copy css for edition

This commit is contained in:
Florian Duros 2022-10-20 10:53:57 +02:00
parent e9b285c5e0
commit 5e6d0f6404
No known key found for this signature in database
GPG key ID: 9700AA5870258A0B
7 changed files with 62 additions and 6 deletions

View file

@ -47,6 +47,7 @@ export function EditWysiwygComposer({ editorStateTransfer, ...props }: EditWysiw
const { editMessage, endEditing, onChange, isSaveDisabled } = useEditing(initialContent, editorStateTransfer);
return isReady && <WysiwygComposer
className="mx_EditWysiwygComposer"
initialContent={initialContent}
onChange={onChange}
onSend={editMessage}

View file

@ -39,7 +39,7 @@ const Content = forwardRef<HTMLElement, ContentProps>(
export function SendWysiwygComposer(props: SendWysiwygComposerProps) {
return (
<WysiwygComposer {...props}>{ (ref, wysiwyg) => (
<WysiwygComposer className="mx_SendWysiwygComposer" {...props}>{ (ref, wysiwyg) => (
<Content disabled={props.disabled} ref={ref} formattingFunctions={wysiwyg} />
) }
</WysiwygComposer>);

View file

@ -26,6 +26,7 @@ interface WysiwygComposerProps {
onChange?: (content: string) => void;
onSend: () => void;
initialContent?: string;
className?: string;
children?: (
ref: MutableRefObject<HTMLDivElement | null>,
wysiwyg: FormattingFunctions,
@ -33,7 +34,7 @@ interface WysiwygComposerProps {
}
export const WysiwygComposer = memo(function WysiwygComposer(
{ disabled = false, onChange, onSend, initialContent, children }: WysiwygComposerProps,
{ disabled = false, onChange, onSend, initialContent, className, children }: WysiwygComposerProps,
) {
const inputEventProcessor = useInputEventProcessor(onSend);
@ -47,7 +48,7 @@ export const WysiwygComposer = memo(function WysiwygComposer(
}, [onChange, content, disabled]);
return (
<div className="mx_WysiwygComposer">
<div className={className}>
<FormattingButtons composer={wysiwyg} formattingStates={formattingStates} />
<Editor ref={ref} disabled={!isWysiwygReady || disabled} />
{ children?.(ref, wysiwyg) }