This commit is contained in:
TaiAurori
2021-08-30 18:24:35 -04:00
32 changed files with 544 additions and 205 deletions

View File

@@ -6,6 +6,7 @@ import { decodeTime } from "ulid";
import { Text } from "preact-i18n";
import { useDictionary } from "../../../lib/i18n";
import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
import { dayjs } from "../../../context/Locale";
@@ -34,9 +35,11 @@ export default styled.div<BaseMessageProps>`
flex-direction: row;
padding-inline-end: 16px;
@media (pointer: coarse) {
user-select: none;
}
${() =>
isTouchscreenDevice &&
css`
user-select: none;
`}
${(props) =>
props.contrast &&

View File

@@ -3,7 +3,7 @@ import Axios, { CancelTokenSource } from "axios";
import { observer } from "mobx-react-lite";
import { ChannelPermission } from "revolt.js/dist/api/permissions";
import { Channel } from "revolt.js/dist/maps/Channels";
import styled from "styled-components";
import styled, { css } from "styled-components";
import { ulid } from "ulid";
import { Text } from "preact-i18n";
@@ -99,11 +99,13 @@ const Action = styled.div`
padding: 12px;
}
.mobile {
@media (pointer: fine) {
display: none;
}
}
${() =>
!isTouchscreenDevice &&
css`
.mobile {
display: none;
}
`}
`;
// For sed replacement
@@ -316,7 +318,8 @@ export default observer(({ channel }: Props) => {
);
}
} catch (err) {
if (err?.message === "cancel") {
// eslint-disable-next-line
if ((err as any)?.message === "cancel") {
setUploadState({
type: "attached",
files,
@@ -502,6 +505,11 @@ export default observer(({ channel }: Props) => {
value={draft ?? ""}
padding="var(--message-box-padding)"
onKeyDown={(e) => {
if (e.ctrlKey && e.key === "Enter") {
e.preventDefault();
return send();
}
if (onKeyDown(e)) return;
if (

View File

@@ -1,10 +1,11 @@
import { DownArrowAlt } from "@styled-icons/boxicons-regular";
import { observer } from "mobx-react-lite";
import { Channel } from "revolt.js/dist/maps/Channels";
import styled from "styled-components";
import styled, { css } from "styled-components";
import { Text } from "preact-i18n";
import { isTouchscreenDevice } from "../../../../lib/isTouchscreenDevice";
import { getRenderer } from "../../../../lib/renderer/Singleton";
const Bar = styled.div`
@@ -42,11 +43,13 @@ const Bar = styled.div`
transform: translateY(1px);
}
@media (pointer: coarse) {
height: 34px;
top: -32px;
padding: 0 12px;
}
${() =>
isTouchscreenDevice &&
css`
height: 34px;
top: -32px;
padding: 0 12px;
`}
}
`;