mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 08:30:58 -05:00
Fix mobile height.
Add send button.
This commit is contained in:
parent
9e460c5b3d
commit
a24bcf9f86
2 changed files with 17 additions and 10 deletions
|
@ -8,7 +8,9 @@ import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
|
|||
import { SingletonMessageRenderer, SMOOTH_SCROLL_ON_RECEIVE } from "../../../lib/renderer/Singleton";
|
||||
import { connectState } from "../../../redux/connector";
|
||||
import { WithDispatcher } from "../../../redux/reducers";
|
||||
import IconButton from "../../ui/IconButton";
|
||||
import TextArea from "../../ui/TextArea";
|
||||
import { Send } from '@styled-icons/feather';
|
||||
|
||||
type Props = WithDispatcher & {
|
||||
channel: Channel;
|
||||
|
@ -70,15 +72,20 @@ function MessageBox({ channel, draft, dispatcher }: Props) {
|
|||
}
|
||||
|
||||
return (
|
||||
<TextArea
|
||||
value={draft}
|
||||
onKeyDown={e => {
|
||||
if (!e.shiftKey && e.key === "Enter" && !isTouchscreenDevice) {
|
||||
e.preventDefault();
|
||||
return send();
|
||||
}
|
||||
}}
|
||||
onChange={e => setMessage(e.currentTarget.value)} />
|
||||
<div style={{ display: 'flex' }}>
|
||||
<TextArea
|
||||
value={draft}
|
||||
onKeyDown={e => {
|
||||
if (!e.shiftKey && e.key === "Enter" && !isTouchscreenDevice) {
|
||||
e.preventDefault();
|
||||
return send();
|
||||
}
|
||||
}}
|
||||
onChange={e => setMessage(e.currentTarget.value)} />
|
||||
<IconButton onClick={send}>
|
||||
<Send size={20} />
|
||||
</IconButton>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ export default function App() {
|
|||
return (
|
||||
<OverlappingPanels
|
||||
width="100vw"
|
||||
height="100%"
|
||||
height="100vh"
|
||||
leftPanel={{ width: 292, component: <LeftSidebar /> }}
|
||||
rightPanel={{ width: 240, component: <RightSidebar /> }}
|
||||
docked={isTouchscreenDevice ? Docked.None : Docked.Left}>
|
||||
|
|
Loading…
Reference in a new issue