Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -7,11 +7,26 @@ import React, {
|
||||
useState,
|
||||
} from 'react';
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { Avatar, Box, Button, IconButton, Line, Menu, MenuItem, PopOut, RectCords, Spinner, Text, color, config, toRem } from 'folds';
|
||||
import { Icon, Icons } from '../../../components/icons';
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
IconButton,
|
||||
Line,
|
||||
Menu,
|
||||
MenuItem,
|
||||
PopOut,
|
||||
RectCords,
|
||||
Spinner,
|
||||
Text,
|
||||
color,
|
||||
config,
|
||||
toRem,
|
||||
} from 'folds';
|
||||
import { JoinRule, Room, Thread, ThreadEvent } from 'matrix-js-sdk';
|
||||
import { RoomJoinRulesEventContent } from 'matrix-js-sdk/lib/types';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import { Icon, Icons } from '../../../components/icons';
|
||||
import { useMatrixClient } from '../../../hooks/useMatrixClient';
|
||||
import { mDirectAtom } from '../../../state/mDirectList';
|
||||
import {
|
||||
@@ -29,7 +44,11 @@ import {
|
||||
useSpaceSearchSelected,
|
||||
} from '../../../hooks/router/useSelectedSpace';
|
||||
import { useSpace } from '../../../hooks/useSpace';
|
||||
import { RoomNavCategoryButton, RoomNavItem, UnjoinedSubRoomItem } from '../../../features/room-nav';
|
||||
import {
|
||||
RoomNavCategoryButton,
|
||||
RoomNavItem,
|
||||
UnjoinedSubRoomItem,
|
||||
} from '../../../features/room-nav';
|
||||
import { makeNavCategoryId } from '../../../state/closedNavCategories';
|
||||
import { roomToUnreadAtom } from '../../../state/room/roomToUnread';
|
||||
import { useCategoryHandler } from '../../../hooks/useCategoryHandler';
|
||||
@@ -152,7 +171,7 @@ function SpaceNavSection({
|
||||
linkPath={getToLink(item.roomId)}
|
||||
notificationMode={getRoomNotificationMode(
|
||||
notificationPreferences,
|
||||
item.roomId
|
||||
item.roomId,
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
@@ -171,10 +190,7 @@ function SpaceNavSection({
|
||||
showAvatar={mDirects.has(item.roomId)}
|
||||
direct={mDirects.has(item.roomId)}
|
||||
linkPath={getToLink(item.roomId)}
|
||||
notificationMode={getRoomNotificationMode(
|
||||
notificationPreferences,
|
||||
room.roomId
|
||||
)}
|
||||
notificationMode={getRoomNotificationMode(notificationPreferences, room.roomId)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -192,7 +208,7 @@ function SpaceHeader() {
|
||||
|
||||
const joinRules = useStateEvent(
|
||||
space,
|
||||
StateEvent.RoomJoinRules
|
||||
StateEvent.RoomJoinRules,
|
||||
)?.getContent<RoomJoinRulesEventContent>();
|
||||
|
||||
const handleOpenMenu: MouseEventHandler<HTMLButtonElement> = (evt) => {
|
||||
@@ -259,7 +275,7 @@ export function SpaceTombstone({ roomId, replacementRoomId }: SpaceTombstoneProp
|
||||
return mx.joinRoom(replacementRoomId, {
|
||||
viaServers: via,
|
||||
});
|
||||
}, [mx, roomId, replacementRoomId])
|
||||
}, [mx, roomId, replacementRoomId]),
|
||||
);
|
||||
const replacementRoom = mx.getRoom(replacementRoomId);
|
||||
|
||||
@@ -343,7 +359,7 @@ export function Space() {
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
[mx, allJoinedRooms]
|
||||
[mx, allJoinedRooms],
|
||||
);
|
||||
|
||||
const hierarchy = useSpaceJoinedHierarchy(
|
||||
@@ -358,12 +374,12 @@ export function Space() {
|
||||
if (showRoom) return false;
|
||||
return true;
|
||||
},
|
||||
[space.roomId, closedCategories, roomToUnread, selectedRoomId]
|
||||
[space.roomId, closedCategories, roomToUnread, selectedRoomId],
|
||||
),
|
||||
useCallback(
|
||||
(sId) => closedCategories.has(makeNavCategoryId(space.roomId, sId)),
|
||||
[closedCategories, space.roomId]
|
||||
)
|
||||
[closedCategories, space.roomId],
|
||||
),
|
||||
);
|
||||
|
||||
// Build a global set of all sub-room IDs to filter from hierarchy
|
||||
@@ -379,9 +395,10 @@ export function Space() {
|
||||
}, [mx, allJoinedRooms, hierarchy]);
|
||||
|
||||
// Filter hierarchy to exclude sub-rooms (they'll be shown nested under their parent)
|
||||
const filteredHierarchy = useMemo(() => {
|
||||
return hierarchy.filter((entry) => !globalSubRoomIds.has(entry.roomId));
|
||||
}, [hierarchy, globalSubRoomIds]);
|
||||
const filteredHierarchy = useMemo(
|
||||
() => hierarchy.filter((entry) => !globalSubRoomIds.has(entry.roomId)),
|
||||
[hierarchy, globalSubRoomIds],
|
||||
);
|
||||
|
||||
// One paper dropdown per space: space header + its rooms/sub-rooms
|
||||
const navSections = useMemo(() => {
|
||||
@@ -397,7 +414,7 @@ export function Space() {
|
||||
const subRooms = subRoomsEvent?.getContent<{ children: string[] }>()?.children ?? [];
|
||||
|
||||
const joinedSubRooms = subRooms.filter(
|
||||
(subRoomId) => !processedSubRooms.has(subRoomId) && mx.getRoom(subRoomId)
|
||||
(subRoomId) => !processedSubRooms.has(subRoomId) && mx.getRoom(subRoomId),
|
||||
);
|
||||
|
||||
joinedSubRooms.forEach((subRoomId, index) => {
|
||||
@@ -434,7 +451,7 @@ export function Space() {
|
||||
if (isSpaceEntry || (room && isSpace(room))) {
|
||||
startSection(
|
||||
entry.roomId,
|
||||
entry.roomId === space.roomId ? 'Rooms' : room?.name ?? entry.roomId
|
||||
entry.roomId === space.roomId ? 'Rooms' : (room?.name ?? entry.roomId),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -453,7 +470,7 @@ export function Space() {
|
||||
}, [mx, filteredHierarchy, space.roomId]);
|
||||
|
||||
const handleCategoryClick = useCategoryHandler(setClosedCategories, (categoryId) =>
|
||||
closedCategories.has(categoryId)
|
||||
closedCategories.has(categoryId),
|
||||
);
|
||||
|
||||
const getToLink = (roomId: string) =>
|
||||
|
||||
Reference in New Issue
Block a user