feat: add send button when message input has content

pull/90/head
moonrailgun 2 years ago
parent aeb523a0ea
commit ed05d61511

@ -15,6 +15,7 @@ import {
import { ChatInputEmotion } from './Emotion'; import { ChatInputEmotion } from './Emotion';
import _uniq from 'lodash/uniq'; import _uniq from 'lodash/uniq';
import { ChatDropArea } from './ChatDropArea'; import { ChatDropArea } from './ChatDropArea';
import { Icon } from 'tailchat-design';
interface ChatInputBoxProps { interface ChatInputBoxProps {
onSendMsg: (msg: string, meta?: SendMessagePayloadMeta) => void; onSendMsg: (msg: string, meta?: SendMessagePayloadMeta) => void;
@ -110,7 +111,16 @@ export const ChatInputBox: React.FC<ChatInputBoxProps> = React.memo((props) => {
<div className="px-2 flex space-x-1"> <div className="px-2 flex space-x-1">
<ChatInputEmotion /> <ChatInputEmotion />
{message ? (
<Icon
icon="mdi:send-circle-outline"
className="text-2xl cursor-pointer"
onClick={() => handleSendMsg()}
/>
) : (
<ChatInputAddon /> <ChatInputAddon />
)}
</div> </div>
<ChatDropArea /> <ChatDropArea />

Loading…
Cancel
Save