chore(refactor): move and re-organise types folder

This commit is contained in:
Paul Makles
2022-06-10 14:11:38 +01:00
parent 67de7dbd79
commit a5e5f3ea0b
53 changed files with 78 additions and 102 deletions

View File

@@ -11,8 +11,6 @@ import { Button, Checkbox } from "@revoltchat/ui";
import { useApplicationState } from "../../mobx/State";
import { SECTION_NSFW } from "../../mobx/stores/Layout";
import { Children } from "../../types/Preact";
const Base = styled.div`
display: flex;
flex-grow: 1;

View File

@@ -4,8 +4,6 @@ import { Details } from "@revoltchat/ui";
import { useApplicationState } from "../../mobx/State";
import { Children } from "../../types/Preact";
interface Props {
id: string;
defaultValue: boolean;
@@ -34,7 +32,7 @@ export default function CollapsibleSection({
}
{...detailsProps}>
<summary>
<div class="padding">
<div className="padding">
<ChevronDown size={20} />
{summary}
</div>

View File

@@ -73,7 +73,7 @@ export default function Emoji({
}
export function generateEmoji(emoji: string) {
return `<img loading="lazy" class="emoji" draggable="false" alt="${emoji}" src="${parseEmoji(
return `<img loading="lazy" className="emoji" draggable="false" alt="${emoji}" src="${parseEmoji(
emoji,
)}" />`;
}

View File

@@ -3,8 +3,6 @@ import styled from "styled-components/macro";
import { Text } from "preact-i18n";
import { Children } from "../../types/Preact";
type Props = Omit<TippyProps, "children"> & {
children: Children;
content: Children;

View File

@@ -31,7 +31,7 @@ export default function UpdateIndicator({ style }: Props) {
if (style === "titlebar") {
return (
<div class="actions">
<div className="actions">
<Tooltip
content="A new update is available!"
placement="bottom">

View File

@@ -16,7 +16,6 @@ import { I18nError } from "../../../context/Locale";
import { useIntermediate } from "../../../context/intermediate/Intermediate";
import { useClient } from "../../../context/revoltjs/RevoltClient";
import { Children } from "../../../types/Preact";
import Markdown from "../../markdown/Markdown";
import UserIcon from "../user/UserIcon";
import { Username } from "../user/UserShort";

View File

@@ -2,8 +2,6 @@ import styled from "styled-components/macro";
import { Ref } from "preact";
import { Children } from "../../../../types/Preact";
const Grid = styled.div<{ width: number; height: number }>`
--width: ${(props) => props.width}px;
--height: ${(props) => props.height}px;

View File

@@ -149,12 +149,12 @@ function FileEntry({
<EmptyEntry className="icon">
<File size={36} />
</EmptyEntry>
<div class="overlay">
<div className="overlay">
<XCircle size={36} />
</div>
</PreviewBox>
<span class="fn">{file.name}</span>
<span class="size">{determineFileSize(file.size)}</span>
<span className="fn">{file.name}</span>
<span className="size">{determineFileSize(file.size)}</span>
</Entry>
);
@@ -169,13 +169,18 @@ function FileEntry({
return (
<Entry className={index >= CAN_UPLOAD_AT_ONCE ? "fade" : ""}>
<PreviewBox onClick={remove}>
<img class="icon" src={url} alt={file.name} loading="eager" />
<div class="overlay">
<img
className="icon"
src={url}
alt={file.name}
loading="eager"
/>
<div className="overlay">
<XCircle size={36} />
</div>
</PreviewBox>
<span class="fn">{file.name}</span>
<span class="size">{determineFileSize(file.size)}</span>
<span className="fn">{file.name}</span>
<span className="size">{determineFileSize(file.size)}</span>
</Entry>
);
}

View File

@@ -152,11 +152,11 @@ export default observer(({ channel, replies, setReplies }: Props) => {
return (
<Base key={reply.id}>
<ReplyBase preview>
<div class="replyto">
<div className="replyto">
<Text id="app.main.channel.reply.replying" />
</div>
<div class="content">
<div class="username">
<div className="content">
<div className="username">
<UserShort
size={16}
showServerIdentity
@@ -164,7 +164,7 @@ export default observer(({ channel, replies, setReplies }: Props) => {
masquerade={message.masquerade!}
/>
</div>
<div class="message">
<div className="message">
{message.attachments && (
<>
<File size={16} />
@@ -196,7 +196,7 @@ export default observer(({ channel, replies, setReplies }: Props) => {
</div>
</div>
</ReplyBase>
<span class="actions">
<span className="actions">
{message.author_id !== client.user!._id && (
<IconButton
onClick={() => {
@@ -225,7 +225,7 @@ export default observer(({ channel, replies, setReplies }: Props) => {
content={
<Text id="app.main.channel.reply.toggle" />
}>
<span class="toggle">
<span className="toggle">
<At size={15} />
<Text
id={

View File

@@ -20,7 +20,7 @@ export default function EmbedMediaActions({ embed }: Props) {
</span>
<a
href={embed.url}
class={styles.openIcon}
className={styles.openIcon}
target="_blank"
rel="noreferrer">
<IconButton>

View File

@@ -1,7 +1,6 @@
import { User } from "revolt.js";
import styled from "styled-components/macro";
import { Children } from "../../../types/Preact";
import Tooltip from "../Tooltip";
import { Username } from "./UserShort";
import UserStatus from "./UserStatus";

View File

@@ -114,7 +114,7 @@ export default observer(
y="0"
width="32"
height="32"
class="icon"
className="icon"
mask={mask ?? (status ? "url(#user)" : undefined)}>
{<img src={url} draggable={false} loading="lazy" />}
</foreignObject>