Format code.

This commit is contained in:
Paul
2021-07-06 19:29:27 +01:00
parent fd23fdb206
commit fb0ae130e9
27 changed files with 188 additions and 116 deletions

View File

@@ -100,14 +100,16 @@ export default function AttachmentActions({ attachment }: Props) {
<File size={24} className={styles.iconType} />
<span className={styles.filename}>{filename}</span>
<span className={styles.filesize}>{filesize}</span>
{ metadata.type === 'Text' && <a
href={open_url}
target="_blank"
className={styles.externalType}>
<IconButton>
<LinkExternal size={24} />
</IconButton>
</a> }
{metadata.type === "Text" && (
<a
href={open_url}
target="_blank"
className={styles.externalType}>
<IconButton>
<LinkExternal size={24} />
</IconButton>
</a>
)}
<a
href={download_url}
className={styles.downloadIcon}

View File

@@ -1,4 +1,5 @@
import { Reply, File } from "@styled-icons/boxicons-regular";
import { SYSTEM_USER_ID } from "revolt.js";
import styled, { css } from "styled-components";
import { Text } from "preact-i18n";
@@ -9,7 +10,6 @@ import { useUser } from "../../../../context/revoltjs/hooks";
import Markdown from "../../../markdown/Markdown";
import UserShort from "../../user/UserShort";
import { SYSTEM_USER_ID } from "revolt.js";
import { SystemMessage } from "../SystemMessage";
interface Props {
@@ -86,13 +86,14 @@ export function MessageReply({ index, channel, id }: Props) {
{message.attachments && message.attachments.length > 0 && (
<File size={16} />
)}
{ message.author === SYSTEM_USER_ID ?
<SystemMessage message={message} /> :
{message.author === SYSTEM_USER_ID ? (
<SystemMessage message={message} />
) : (
<Markdown
disallowBigEmoji
content={(message.content as string).replace(/\n/g, " ")}
/>
}
)}
</ReplyBase>
);
}

View File

@@ -31,7 +31,9 @@ export default function TextFile({ attachment }: Props) {
if (loading) return;
if (attachment.size > 20_000) {
setContent('This file is > 20 KB, for your sake I did not load it.\nSee tracking issue here for previews: https://gitlab.insrt.uk/revolt/revite/-/issues/2');
setContent(
"This file is > 20 KB, for your sake I did not load it.\nSee tracking issue here for previews: https://gitlab.insrt.uk/revolt/revite/-/issues/2",
);
return;
}