diff --git a/src/components/Chat/Chat.js b/src/components/Chat/Chat.js index d6b4150f..578ba80f 100644 --- a/src/components/Chat/Chat.js +++ b/src/components/Chat/Chat.js @@ -43,6 +43,8 @@ export const Chat = ({ backAction, composerBlockedMessage, onSendReactGAEvent, + text, + setText, }) => { const theme = useTheme(); const [location, setLocation] = useState( @@ -97,6 +99,8 @@ export const Chat = ({ uploadOptions={uploadOptions} backAction={backAction} onSendReactGAEvent={onSendReactGAEvent} + text={text} + setText={setText} /> diff --git a/src/components/Chat/Maximized/InputComposer/InputComposer.js b/src/components/Chat/Maximized/InputComposer/InputComposer.js index 568be94b..0e36f2b8 100644 --- a/src/components/Chat/Maximized/InputComposer/InputComposer.js +++ b/src/components/Chat/Maximized/InputComposer/InputComposer.js @@ -53,6 +53,8 @@ export const InputComposer = ({ setDroppedFiles, uploadOptions, onSendReactGAEvent, + text, + updateText, }) => { const classes = useStyle(); const [writing, setWriting] = useState(false); @@ -132,7 +134,11 @@ export const InputComposer = ({ setFiles({}); setWriting(false); }; - const onChange = e => setWriting(e.currentTarget.value !== ''); + + const onChange = e => { + setWriting(e.currentTarget.value !== ''); + updateText(e.currentTarget.value); + }; const inputRef1 = ref => setInputRef(ref); const style1 = { maxHeight: 37, maxWidth: 35 }; const style2 = { maxHeight: 26, maxWidth: 24 }; @@ -258,6 +264,7 @@ export const InputComposer = ({ inputRef={inputRef1} active={!disabledSend && !isBlocked} style={style} + defaultValue={text} > {!recording && ( diff --git a/src/components/Chat/Maximized/Maximized.js b/src/components/Chat/Maximized/Maximized.js index d8927c79..360c789d 100644 --- a/src/components/Chat/Maximized/Maximized.js +++ b/src/components/Chat/Maximized/Maximized.js @@ -47,10 +47,13 @@ const Maximized = ({ uploadOptions, backAction, onSendReactGAEvent, + text, + setText, }) => { const classes = useStyle(); const theme = useTheme(); const [droppedFiles, setDroppedFiles] = useState(null); + let currentText = text; const onBackward = backAction || @@ -77,6 +80,15 @@ const Maximized = ({ const dropZoneHeight = { height: '100%' }; + const handleLoadMore = () => { + setText(currentText); + loadMore(); + }; + + const handleChangeCurrentText = text => { + currentText = text; + }; + return (
handleChangeCurrentText(text)} /> )}