Skip to content
Snippets Groups Projects
Commit a24bcf9f authored by insert's avatar insert
Browse files

Fix mobile height.

Add send button.
parent 9e460c5b
Branches
No related merge requests found
...@@ -8,7 +8,9 @@ import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice"; ...@@ -8,7 +8,9 @@ import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
import { SingletonMessageRenderer, SMOOTH_SCROLL_ON_RECEIVE } from "../../../lib/renderer/Singleton"; import { SingletonMessageRenderer, SMOOTH_SCROLL_ON_RECEIVE } from "../../../lib/renderer/Singleton";
import { connectState } from "../../../redux/connector"; import { connectState } from "../../../redux/connector";
import { WithDispatcher } from "../../../redux/reducers"; import { WithDispatcher } from "../../../redux/reducers";
import IconButton from "../../ui/IconButton";
import TextArea from "../../ui/TextArea"; import TextArea from "../../ui/TextArea";
import { Send } from '@styled-icons/feather';
type Props = WithDispatcher & { type Props = WithDispatcher & {
channel: Channel; channel: Channel;
...@@ -70,15 +72,20 @@ function MessageBox({ channel, draft, dispatcher }: Props) { ...@@ -70,15 +72,20 @@ function MessageBox({ channel, draft, dispatcher }: Props) {
} }
return ( return (
<TextArea <div style={{ display: 'flex' }}>
value={draft} <TextArea
onKeyDown={e => { value={draft}
if (!e.shiftKey && e.key === "Enter" && !isTouchscreenDevice) { onKeyDown={e => {
e.preventDefault(); if (!e.shiftKey && e.key === "Enter" && !isTouchscreenDevice) {
return send(); e.preventDefault();
} return send();
}} }
onChange={e => setMessage(e.currentTarget.value)} /> }}
onChange={e => setMessage(e.currentTarget.value)} />
<IconButton onClick={send}>
<Send size={20} />
</IconButton>
</div>
) )
} }
......
...@@ -29,7 +29,7 @@ export default function App() { ...@@ -29,7 +29,7 @@ export default function App() {
return ( return (
<OverlappingPanels <OverlappingPanels
width="100vw" width="100vw"
height="100%" height="100vh"
leftPanel={{ width: 292, component: <LeftSidebar /> }} leftPanel={{ width: 292, component: <LeftSidebar /> }}
rightPanel={{ width: 240, component: <RightSidebar /> }} rightPanel={{ width: 240, component: <RightSidebar /> }}
docked={isTouchscreenDevice ? Docked.None : Docked.Left}> docked={isTouchscreenDevice ? Docked.None : Docked.Left}>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment