fix: remove unused useRoomName import, run prettier on all changed files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+345
-201
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,16 @@
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import { Avatar, Box, Button, Overlay, OverlayBackdrop, OverlayCenter, Spinner, Text, as } from 'folds';
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
Overlay,
|
||||
OverlayBackdrop,
|
||||
OverlayCenter,
|
||||
Spinner,
|
||||
Text,
|
||||
as,
|
||||
} from 'folds';
|
||||
import { Room } from 'matrix-js-sdk';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { IRoomCreateContent, Membership, StateEvent } from '../../../types/matrix/room';
|
||||
@@ -98,7 +108,13 @@ export const RoomIntro = as<'div', RoomIntroProps>(({ room, ...props }, ref) =>
|
||||
onClick={() => setViewTopic(true)}
|
||||
size="T400"
|
||||
priority="400"
|
||||
style={{ background: 'none', border: 'none', padding: 0, cursor: 'pointer', textAlign: 'left' }}
|
||||
style={{
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
padding: 0,
|
||||
cursor: 'pointer',
|
||||
textAlign: 'left',
|
||||
}}
|
||||
>
|
||||
{topic.topic}
|
||||
</Text>
|
||||
|
||||
@@ -594,9 +594,7 @@ function RoomNavItem_({
|
||||
</PopOut>
|
||||
</NavItemOptions>
|
||||
)}
|
||||
{renameDialog && (
|
||||
<RenameRoomDialog room={room} onClose={() => setRenameDialog(false)} />
|
||||
)}
|
||||
{renameDialog && <RenameRoomDialog room={room} onClose={() => setRenameDialog(false)} />}
|
||||
</NavItem>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,9 +67,10 @@ export function ReportRoomModal({ roomId, onClose }: ReportRoomModalProps) {
|
||||
submitReport(fullReason);
|
||||
};
|
||||
|
||||
const errcode = (reportState.status === AsyncStatus.Error
|
||||
? (reportState.error as { errcode?: string })?.errcode
|
||||
: undefined);
|
||||
const errcode =
|
||||
reportState.status === AsyncStatus.Error
|
||||
? (reportState.error as { errcode?: string })?.errcode
|
||||
: undefined;
|
||||
const errorMsg =
|
||||
errcode === 'M_LIMIT_EXCEEDED'
|
||||
? 'You are being rate limited. Please wait before reporting again.'
|
||||
@@ -113,7 +114,9 @@ export function ReportRoomModal({ roomId, onClose }: ReportRoomModalProps) {
|
||||
size="500"
|
||||
>
|
||||
<Box grow="Yes">
|
||||
<Text id="report-room-dialog-title" size="H4">Report Room</Text>
|
||||
<Text id="report-room-dialog-title" size="H4">
|
||||
Report Room
|
||||
</Text>
|
||||
</Box>
|
||||
<IconButton size="300" onClick={onClose} radii="300" aria-label="Close">
|
||||
<Icon src={Icons.Cross} />
|
||||
@@ -126,7 +129,9 @@ export function ReportRoomModal({ roomId, onClose }: ReportRoomModalProps) {
|
||||
</Text>
|
||||
|
||||
<Box direction="Column" gap="100">
|
||||
<Text as="label" htmlFor="report-category" size="L400">Category</Text>
|
||||
<Text as="label" htmlFor="report-category" size="L400">
|
||||
Category
|
||||
</Text>
|
||||
<Box
|
||||
as="select"
|
||||
id="report-category"
|
||||
@@ -155,7 +160,9 @@ export function ReportRoomModal({ roomId, onClose }: ReportRoomModalProps) {
|
||||
</Box>
|
||||
|
||||
<Box direction="Column" gap="100">
|
||||
<Text as="label" htmlFor="report-reason-input" size="L400">Reason</Text>
|
||||
<Text as="label" htmlFor="report-reason-input" size="L400">
|
||||
Reason
|
||||
</Text>
|
||||
<Input
|
||||
id="report-reason-input"
|
||||
name="reasonInput"
|
||||
|
||||
@@ -48,7 +48,7 @@ import { markAsRead } from '../../utils/notifications';
|
||||
import { roomToUnreadAtom } from '../../state/room/roomToUnread';
|
||||
import { copyToClipboard } from '../../utils/dom';
|
||||
import { LeaveRoomPrompt } from '../../components/leave-room-prompt';
|
||||
import { useRoomAvatar, useRoomName, useLocalRoomName, useRoomTopic } from '../../hooks/useRoomMeta';
|
||||
import { useRoomAvatar, useLocalRoomName, useRoomTopic } from '../../hooks/useRoomMeta';
|
||||
import { useReportRoomSupported } from '../../hooks/useReportRoomSupported';
|
||||
import { ScreenSize, useScreenSizeContext } from '../../hooks/useScreenSize';
|
||||
import { stopPropagation } from '../../utils/keyboard';
|
||||
|
||||
@@ -179,7 +179,9 @@ export function About({ requestClose }: AboutProps) {
|
||||
{supportLoading && !serverSupport && (
|
||||
<Box alignItems="Center" gap="200">
|
||||
<Spinner size="100" variant="Secondary" />
|
||||
<Text size="T300" priority="300">Loading support info…</Text>
|
||||
<Text size="T300" priority="300">
|
||||
Loading support info…
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
{serverSupport?.contacts && serverSupport.contacts.length > 0 && (
|
||||
@@ -189,7 +191,11 @@ export function About({ requestClose }: AboutProps) {
|
||||
<Text size="T300" priority="300">
|
||||
{formatRole(contact.role)}:
|
||||
</Text>
|
||||
<Box direction="Column" gap="100" style={{ paddingLeft: config.space.S200 }}>
|
||||
<Box
|
||||
direction="Column"
|
||||
gap="100"
|
||||
style={{ paddingLeft: config.space.S200 }}
|
||||
>
|
||||
{contact.matrix_id && (
|
||||
<Text
|
||||
as="a"
|
||||
@@ -202,11 +208,7 @@ export function About({ requestClose }: AboutProps) {
|
||||
</Text>
|
||||
)}
|
||||
{contact.email_address && (
|
||||
<Text
|
||||
as="a"
|
||||
href={`mailto:${contact.email_address}`}
|
||||
size="T300"
|
||||
>
|
||||
<Text as="a" href={`mailto:${contact.email_address}`} size="T300">
|
||||
{contact.email_address}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
@@ -972,7 +972,10 @@ function ChatBgGrid() {
|
||||
...getChatBg(opt.value as ChatBackground, isDark),
|
||||
}}
|
||||
/>
|
||||
<Text size="T200" style={chatBackground === opt.value ? { color: color.Critical.Main } : undefined}>
|
||||
<Text
|
||||
size="T200"
|
||||
style={chatBackground === opt.value ? { color: color.Critical.Main } : undefined}
|
||||
>
|
||||
{opt.label}
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
@@ -39,7 +39,9 @@ export const LOCAL_ROOM_NAMES_KEY = 'io.lotus.room_names';
|
||||
|
||||
export type LocalRoomNamesContent = { rooms: Record<string, string> };
|
||||
|
||||
export function getLocalRoomNamesContent(mx: ReturnType<typeof useMatrixClient>): LocalRoomNamesContent {
|
||||
export function getLocalRoomNamesContent(
|
||||
mx: ReturnType<typeof useMatrixClient>,
|
||||
): LocalRoomNamesContent {
|
||||
// Use any-cast because LOCAL_ROOM_NAMES_KEY is not in matrix-js-sdk AccountDataEvents
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const raw: unknown = (mx as any).getAccountData(LOCAL_ROOM_NAMES_KEY)?.getContent();
|
||||
|
||||
Reference in New Issue
Block a user