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}> {/*<IconButton onClick={emojiPicker}>
<HappyAlt size={20} /> <HappyAlt size={20} />
</IconButton>*/} </IconButton>*/}
<IconButton className="mobile" onClick={send}> <IconButton
className="mobile" onClick={send}
onMouseDown={e => e.preventDefault()}>
<Send size={20} /> <Send size={20} />
</IconButton> </IconButton>
</Action> </Action>

View file

@ -82,8 +82,6 @@ function HomeSidebar(props: Props) {
<GenericSidebarBase padding> <GenericSidebarBase padding>
<ConnectionStatus /> <ConnectionStatus />
<GenericSidebarList> <GenericSidebarList>
{!isTouchscreenDevice && (
<>
<ConditionalLink active={pathname === "/"} to="/"> <ConditionalLink active={pathname === "/"} to="/">
<ButtonItem active={pathname === "/"}> <ButtonItem active={pathname === "/"}>
<Home size={20} /> <Home size={20} />
@ -92,6 +90,8 @@ function HomeSidebar(props: Props) {
</span> </span>
</ButtonItem> </ButtonItem>
</ConditionalLink> </ConditionalLink>
{!isTouchscreenDevice && (
<>
<ConditionalLink <ConditionalLink
active={pathname === "/friends"} active={pathname === "/friends"}
to="/friends"> to="/friends">

View file

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