mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 17:35:28 +00:00
Fix mobile height.
Add send button.
This commit is contained in:
@@ -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) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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() {
|
|||||||
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}>
|
||||||
|
|||||||
Reference in New Issue
Block a user