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