Fix: Don't lose focus on send.

Sidebar: Show home button on mobile.
This commit is contained in:
Paul 2021-07-10 11:21:05 +01:00
parent 586b153eb8
commit 6a2dd50236
3 changed files with 28 additions and 20 deletions

View file

@ -501,7 +501,9 @@ export default function MessageBox({ channel }: Props) {
{/*<IconButton onClick={emojiPicker}>
<HappyAlt size={20} />
</IconButton>*/}
<IconButton className="mobile" onClick={send}>
<IconButton
className="mobile" onClick={send}
onMouseDown={e => e.preventDefault()}>
<Send size={20} />
</IconButton>
</Action>

View file

@ -82,16 +82,16 @@ function HomeSidebar(props: Props) {
<GenericSidebarBase padding>
<ConnectionStatus />
<GenericSidebarList>
<ConditionalLink active={pathname === "/"} to="/">
<ButtonItem active={pathname === "/"}>
<Home size={20} />
<span>
<Text id="app.navigation.tabs.home" />
</span>
</ButtonItem>
</ConditionalLink>
{!isTouchscreenDevice && (
<>
<ConditionalLink active={pathname === "/"} to="/">
<ButtonItem active={pathname === "/"}>
<Home size={20} />
<span>
<Text id="app.navigation.tabs.home" />
</span>
</ButtonItem>
</ConditionalLink>
<ConditionalLink
active={pathname === "/friends"}
to="/friends">

View file

@ -28,6 +28,7 @@ import IconButton from "../../ui/IconButton";
import LineDivider from "../../ui/LineDivider";
import { mapChannelWithUnread } from "./common";
import logoSVG from '../../../assets/logo.svg';
import { Children } from "../../../types/Preact";
import UserHover from "../../common/user/UserHover";
@ -237,17 +238,22 @@ export function ServerListSidebar({ unreads, lastOpened }: Props) {
active={homeActive}
to={lastOpened.home ? `/channel/${lastOpened.home}` : "/"}>
<ServerEntry home active={homeActive}>
<div
onContextMenu={attachContextMenu("Status")}
onClick={() =>
homeActive && openContextMenu("Status")
}>
<UserHover user={self}>
<Icon size={42} unread={homeUnread}>
<UserIcon target={self} size={32} status />
</Icon>
</UserHover>
</div>
{ isTouchscreenDevice ?
<Icon size={42} unread={homeUnread}>
<img style={{ width: 32, height: 32 }} src={logoSVG} />
</Icon> :
<div
onContextMenu={attachContextMenu("Status")}
onClick={() =>
homeActive && openContextMenu("Status")
}>
<UserHover user={self}>
<Icon size={42} unread={homeUnread}>
<UserIcon target={self} size={32} status />
</Icon>
</UserHover>
</div>
}
<span />
</ServerEntry>
</ConditionalLink>