Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -1,7 +1,30 @@
|
||||
import React, { FormEventHandler, KeyboardEventHandler, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import React, {
|
||||
FormEventHandler,
|
||||
KeyboardEventHandler,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { isKeyHotkey } from 'is-hotkey';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import { Box, Button, Header, IconButton, Modal, Overlay, OverlayBackdrop, OverlayCenter, Line, Scroll, Text, color, config, toRem } from 'folds';
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Header,
|
||||
IconButton,
|
||||
Modal,
|
||||
Overlay,
|
||||
OverlayBackdrop,
|
||||
OverlayCenter,
|
||||
Line,
|
||||
Scroll,
|
||||
Text,
|
||||
color,
|
||||
config,
|
||||
toRem,
|
||||
} from 'folds';
|
||||
import { Icon, Icons } from '../../components/icons';
|
||||
import {
|
||||
CustomEditor,
|
||||
@@ -85,7 +108,7 @@ export function ForumNewPostModal({
|
||||
const trimmedTitle = title.trim();
|
||||
const plainText = toPlainText(editor.children, false).trim();
|
||||
const formattedHtml = trimCustomHtml(
|
||||
toMatrixCustomHTML(editor.children, FORUM_EDITOR_OUTPUT_OPTS)
|
||||
toMatrixCustomHTML(editor.children, FORUM_EDITOR_OUTPUT_OPTS),
|
||||
);
|
||||
|
||||
const hasText = !isEmptyEditor(editor);
|
||||
@@ -165,7 +188,7 @@ export function ForumNewPostModal({
|
||||
sending,
|
||||
title,
|
||||
topicRoomId,
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
const handleEditorKeyDown: KeyboardEventHandler = useCallback(
|
||||
@@ -175,7 +198,7 @@ export function ForumNewPostModal({
|
||||
evt.currentTarget.closest('form')?.requestSubmit();
|
||||
}
|
||||
},
|
||||
[sending]
|
||||
[sending],
|
||||
);
|
||||
|
||||
const handleCategoryChange = useCallback((next: string) => {
|
||||
@@ -215,7 +238,13 @@ export function ForumNewPostModal({
|
||||
<Box grow="Yes">
|
||||
<Text size="H4">New post</Text>
|
||||
</Box>
|
||||
<IconButton size="300" radii="300" onClick={handleClose} disabled={sending} aria-label="Close">
|
||||
<IconButton
|
||||
size="300"
|
||||
radii="300"
|
||||
onClick={handleClose}
|
||||
disabled={sending}
|
||||
aria-label="Close"
|
||||
>
|
||||
<Icon src={Icons.Cross} />
|
||||
</IconButton>
|
||||
</Header>
|
||||
@@ -264,7 +293,11 @@ export function ForumNewPostModal({
|
||||
bottom={
|
||||
<div>
|
||||
<Line variant="SurfaceVariant" size="300" />
|
||||
<Box alignItems="Center" gap="200" style={{ padding: `0 ${config.space.S200}` }}>
|
||||
<Box
|
||||
alignItems="Center"
|
||||
gap="200"
|
||||
style={{ padding: `0 ${config.space.S200}` }}
|
||||
>
|
||||
<ForumPostUploadField
|
||||
roomId={uploadRoomKey}
|
||||
disabled={sending || !topicRoomId}
|
||||
|
||||
Reference in New Issue
Block a user