Changeset View
Changeset View
Standalone View
Standalone View
web/chat/edit-text-message.react.js
Show All 21 Lines | |||||
}; | }; | ||||
const cancelButtonColor: ButtonColor = { | const cancelButtonColor: ButtonColor = { | ||||
backgroundColor: 'transparent', | backgroundColor: 'transparent', | ||||
}; | }; | ||||
function EditTextMessage(props: Props): React.Node { | function EditTextMessage(props: Props): React.Node { | ||||
const { background, threadInfo } = props; | const { background, threadInfo } = props; | ||||
const { editState, clearEditModal } = useEditModalContext(); | const { editState, clearEditModal, setDraft } = useEditModalContext(); | ||||
const editedMessageDraft = editState?.editedMessageDraft ?? ''; | const editedMessageDraft = editState?.editedMessageDraft ?? ''; | ||||
const threadColor = threadInfo.color; | const threadColor = threadInfo.color; | ||||
const saveButtonColor: ButtonColor = React.useMemo( | const saveButtonColor: ButtonColor = React.useMemo( | ||||
() => ({ | () => ({ | ||||
backgroundColor: `#${threadColor}`, | backgroundColor: `#${threadColor}`, | ||||
}), | }), | ||||
[threadColor], | [threadColor], | ||||
Show All 14 Lines | function EditTextMessage(props: Props): React.Node { | ||||
}); | }); | ||||
return ( | return ( | ||||
<div className={containerStyle}> | <div className={containerStyle}> | ||||
<div className={cssInputBar.inputBarTextInput}> | <div className={cssInputBar.inputBarTextInput}> | ||||
<ChatInputTextArea | <ChatInputTextArea | ||||
focus={!background} | focus={!background} | ||||
currentText={editedMessageDraft} | currentText={editedMessageDraft} | ||||
setCurrentText={setDraft} | |||||
/> | /> | ||||
</div> | </div> | ||||
<div className={css.bottomRow}> | <div className={css.bottomRow}> | ||||
{editFailed} | {editFailed} | ||||
<div className={css.buttons}> | <div className={css.buttons}> | ||||
<Button | <Button | ||||
className={[css.saveButton, css.smallButton]} | className={[css.saveButton, css.smallButton]} | ||||
variant="filled" | variant="filled" | ||||
Show All 34 Lines |