Ran formatting and lint checks.
Temporarily removed add space and room buttons from children items in lobby view. Added exclusion callback to getSpaceHierarchy
This commit is contained in:
1 parent
10a2c400b2
commit
f4d454cd2b
7 files changed
+661
-327
No files matched your search
@@ -1,5 +1,25 @@
|
||||
import { MouseEventHandler, ReactElement, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { Box, Chip, Icon, IconButton, Icons, Line, Scroll, Spinner, Text, color, config } from 'folds';
|
||||
import {
|
||||
MouseEventHandler,
|
||||
ReactElement,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import {
|
||||
Box,
|
||||
Chip,
|
||||
Icon,
|
||||
IconButton,
|
||||
Icons,
|
||||
Line,
|
||||
Scroll,
|
||||
Spinner,
|
||||
Text,
|
||||
color,
|
||||
config,
|
||||
} from 'folds';
|
||||
import { useVirtualizer, VirtualItem } from '@tanstack/react-virtual';
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
@@ -13,7 +33,7 @@ import {
|
||||
import { produce } from 'immer';
|
||||
import { useSpace } from '$hooks/useSpace';
|
||||
import { Page, PageContent, PageContentCenter, PageHeroSection } from '$components/page';
|
||||
import { HierarchyItem, HierarchyItemSpace, SpaceHierarchy, useSpaceHierarchy } from '$hooks/useSpaceHierarchy';
|
||||
import { HierarchyItem, HierarchyItemSpace, useSpaceHierarchy } from '$hooks/useSpaceHierarchy';
|
||||
import { VirtualTile } from '$components/virtualizer';
|
||||
import { spaceRoomsAtom } from '$state/spaceRooms';
|
||||
import { useSetting } from '$state/hooks/settings';
|
||||
@@ -56,6 +76,7 @@ import { SpaceHierarchyItem } from './SpaceHierarchyItem';
|
||||
import { CanDropCallback, useDnDMonitor } from './DnD';
|
||||
import { LobbyHero } from './LobbyHero';
|
||||
import { LobbyHeader } from './LobbyHeader';
|
||||
import { SpaceHierarchyNavItem } from './SpaceHierarchyNavItem';
|
||||
|
||||
const useCanDropLobbyItem = (
|
||||
space: Room,
|
||||
@@ -273,11 +294,16 @@ export function Lobby() {
|
||||
return !Array.from(parentIds).some((id) => !getInClosedCategories(spaceId, id, roomId));
|
||||
};
|
||||
|
||||
const [subspaceHierarchyLimit] = useSetting(settingsAtom, 'subspaceHierarchyLimit');
|
||||
const [draggingItem, setDraggingItem] = useState<HierarchyItem>();
|
||||
const hierarchy = useSpaceHierarchy(
|
||||
space.roomId,
|
||||
spaceRooms,
|
||||
getRoom,
|
||||
useCallback(
|
||||
(_childId, _spaceId, depth) => depth >= subspaceHierarchyLimit,
|
||||
[subspaceHierarchyLimit]
|
||||
),
|
||||
useCallback(
|
||||
(childId) =>
|
||||
getInClosedCategories(space.roomId, childId) ||
|
||||
@@ -520,73 +546,76 @@ export function Lobby() {
|
||||
[mx, sidebarItems, sidebarSpaces]
|
||||
);
|
||||
|
||||
const getPaddingTop = (hierarchy: SpaceHierarchy[], vItem: VirtualItem) => {
|
||||
const getPaddingTop = (vItem: VirtualItem) => {
|
||||
if (vItem.index === 0) return 0;
|
||||
const prevDepth = hierarchy[vItem.index - 1]?.space.depth ?? 0;
|
||||
const depth = hierarchy[vItem.index].space.depth;
|
||||
const { depth } = hierarchy[vItem.index].space;
|
||||
if (depth !== 1 && depth >= prevDepth) return config.space.S200;
|
||||
return config.space.S500;
|
||||
};
|
||||
|
||||
const getConnectorSVG = useCallback((hierarchy: SpaceHierarchy[], virtualizedItems: VirtualItem[]): ReactElement => {
|
||||
const PADDING_LEFT_DEPTH_OFFSET = 15.75;
|
||||
const PADDING_LEFT_DEPTH_OFFSET_START = -15;
|
||||
const getConnectorSVG = useCallback(
|
||||
(virtualizedItems: VirtualItem[]): ReactElement => {
|
||||
const PADDING_LEFT_DEPTH_OFFSET = 15.75;
|
||||
const PADDING_LEFT_DEPTH_OFFSET_START = -15;
|
||||
|
||||
var aY: number = 0;
|
||||
// Holder for the paths
|
||||
const pathHolder: ReactElement[] = [];
|
||||
virtualizedItems.forEach((vItem) => {
|
||||
const { depth } = hierarchy[vItem.index].space ?? {};
|
||||
let aY = 0;
|
||||
// Holder for the paths
|
||||
const pathHolder: ReactElement[] = [];
|
||||
virtualizedItems.forEach((vItem) => {
|
||||
const { depth } = hierarchy[vItem.index].space ?? {};
|
||||
|
||||
// We will render spaces at a level above their normal depth, since we want their children to be "under" them
|
||||
// for the root items, we are not doing anything with it.
|
||||
if (depth < 1) {
|
||||
return;
|
||||
}
|
||||
// for the sub-root items, we will not draw any arcs from root to it.
|
||||
// however, we should capture the aX and aY to draw starter arcs for next depths.
|
||||
if (depth === 1) {
|
||||
aY = vItem.end;
|
||||
return;
|
||||
}
|
||||
|
||||
const pathStrings: string[] = [];
|
||||
|
||||
for (let iDepth = 0; iDepth < depth; iDepth += 1) {
|
||||
const X = iDepth * PADDING_LEFT_DEPTH_OFFSET + PADDING_LEFT_DEPTH_OFFSET_START;
|
||||
|
||||
const bY = vItem.end;
|
||||
|
||||
pathStrings.push(`M ${X} ${aY} L ${X} ${bY}`);
|
||||
}
|
||||
|
||||
pathHolder.push(
|
||||
<path
|
||||
d={pathStrings.join(' ')}
|
||||
fill="none"
|
||||
stroke={color.Surface.ContainerLine}
|
||||
strokeWidth={config.borderWidth.B300}
|
||||
display="block"
|
||||
/>
|
||||
);
|
||||
|
||||
// We will render spaces at a level above their normal depth, since we want their children to be "under" them
|
||||
// for the root items, we are not doing anything with it.
|
||||
if (depth < 1) {
|
||||
return;
|
||||
}
|
||||
// for the sub-root items, we will not draw any arcs from root to it.
|
||||
// however, we should capture the aX and aY to draw starter arcs for next depths.
|
||||
if (depth === 1) {
|
||||
aY = vItem.end;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
var pathStrings: string[] = [];
|
||||
|
||||
for (var iDepth = 0; iDepth < depth; iDepth++) {
|
||||
var X = iDepth * PADDING_LEFT_DEPTH_OFFSET + PADDING_LEFT_DEPTH_OFFSET_START;
|
||||
|
||||
var bY = vItem.end;
|
||||
|
||||
pathStrings.push(`M ${X} ${aY} L ${X} ${bY}`);
|
||||
}
|
||||
|
||||
pathHolder.push(
|
||||
<path
|
||||
d={pathStrings.join(" ")}
|
||||
fill="none"
|
||||
stroke={color.Surface.ContainerLine}
|
||||
strokeWidth={config.borderWidth.B300}
|
||||
display="block"
|
||||
/>
|
||||
return (
|
||||
<svg
|
||||
style={{
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
pointerEvents: 'none',
|
||||
}}
|
||||
>
|
||||
{pathHolder}
|
||||
</svg>
|
||||
);
|
||||
|
||||
aY = vItem.end;
|
||||
});
|
||||
|
||||
return (
|
||||
<svg
|
||||
style={{
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
pointerEvents: 'none',
|
||||
}}
|
||||
>
|
||||
{pathHolder}
|
||||
</svg>
|
||||
);
|
||||
}, [hierarchy, vItems]);
|
||||
},
|
||||
[hierarchy]
|
||||
);
|
||||
|
||||
return (
|
||||
<PowerLevelsContextProvider value={spacePowerLevels}>
|
||||
@@ -641,39 +670,57 @@ export function Lobby() {
|
||||
<VirtualTile
|
||||
virtualItem={vItem}
|
||||
style={{
|
||||
paddingTop: getPaddingTop(hierarchy, vItem),
|
||||
paddingTop: getPaddingTop(vItem),
|
||||
paddingLeft,
|
||||
}}
|
||||
ref={virtualizer.measureElement}
|
||||
key={vItem.index}
|
||||
>
|
||||
<SpaceHierarchyItem
|
||||
spaceItem={item.space}
|
||||
summary={spacesItems.get(item.space.roomId)}
|
||||
roomItems={item.rooms}
|
||||
allJoinedRooms={allJoinedRooms}
|
||||
mDirects={mDirects}
|
||||
roomsPowerLevels={roomsPowerLevels}
|
||||
categoryId={categoryId}
|
||||
closed={
|
||||
inClosedCategory || (draggingItem ? 'space' in draggingItem : false)
|
||||
}
|
||||
handleClose={handleCategoryClick}
|
||||
draggingItem={draggingItem}
|
||||
onDragging={setDraggingItem}
|
||||
canDrop={canDrop}
|
||||
disabledReorder={reordering}
|
||||
nextSpaceId={nextSpaceId}
|
||||
getRoom={getRoom}
|
||||
pinned={sidebarSpaces.has(item.space.roomId)}
|
||||
togglePinToSidebar={togglePinToSidebar}
|
||||
onSpacesFound={handleSpacesFound}
|
||||
onOpenRoom={handleOpenRoom}
|
||||
/>
|
||||
{item.space.depth !== subspaceHierarchyLimit ? (
|
||||
<SpaceHierarchyItem
|
||||
spaceItem={item.space}
|
||||
roomItems={item.rooms}
|
||||
summary={spacesItems.get(item.space.roomId)}
|
||||
allJoinedRooms={allJoinedRooms}
|
||||
mDirects={mDirects}
|
||||
roomsPowerLevels={roomsPowerLevels}
|
||||
categoryId={categoryId}
|
||||
closed={
|
||||
inClosedCategory || (draggingItem ? 'space' in draggingItem : false)
|
||||
}
|
||||
handleClose={handleCategoryClick}
|
||||
draggingItem={draggingItem}
|
||||
onDragging={setDraggingItem}
|
||||
canDrop={canDrop}
|
||||
disabledReorder={reordering}
|
||||
nextSpaceId={nextSpaceId}
|
||||
getRoom={getRoom}
|
||||
pinned={sidebarSpaces.has(item.space.roomId)}
|
||||
togglePinToSidebar={togglePinToSidebar}
|
||||
onSpacesFound={handleSpacesFound}
|
||||
onOpenRoom={handleOpenRoom}
|
||||
/>
|
||||
) : (
|
||||
<SpaceHierarchyNavItem
|
||||
spaceItem={item.space}
|
||||
summary={spacesItems.get(item.space.roomId)}
|
||||
allJoinedRooms={allJoinedRooms}
|
||||
roomsPowerLevels={roomsPowerLevels}
|
||||
categoryId={categoryId}
|
||||
draggingItem={draggingItem}
|
||||
onDragging={setDraggingItem}
|
||||
canDrop={canDrop}
|
||||
disabledReorder={reordering}
|
||||
nextSpaceId={nextSpaceId}
|
||||
pinned={sidebarSpaces.has(item.space.roomId)}
|
||||
togglePinToSidebar={togglePinToSidebar}
|
||||
getRoom={getRoom}
|
||||
/>
|
||||
)}
|
||||
</VirtualTile>
|
||||
);
|
||||
})}
|
||||
{getConnectorSVG(hierarchy, vItems)}
|
||||
{getConnectorSVG(vItems)}
|
||||
</div>
|
||||
{reordering && (
|
||||
<Box
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { forwardRef, MouseEventHandler, useEffect, useMemo } from 'react';
|
||||
import { forwardRef, MouseEventHandler, useEffect, useMemo, useState } from 'react';
|
||||
import { MatrixError, Room, IHierarchyRoom } from '$types/matrix-sdk';
|
||||
import { Box, config, Text } from 'folds';
|
||||
import {
|
||||
@@ -98,15 +98,19 @@ export const SpaceHierarchyItem = forwardRef<HTMLDivElement, SpaceHierarchyItemP
|
||||
onSpacesFound(Array.from(subspaces.values()));
|
||||
}, [subspaces, onSpacesFound]);
|
||||
|
||||
let childItems = roomItems?.filter((i) => !subspaces.has(i.roomId));
|
||||
if (!spacePermissions?.stateEvent(StateEvent.SpaceChild, mx.getSafeUserId())) {
|
||||
// hide unknown rooms for normal user
|
||||
childItems = childItems?.filter((i) => {
|
||||
const forbidden = error instanceof MatrixError ? error.errcode === 'M_FORBIDDEN' : false;
|
||||
const inaccessibleRoom = !rooms.get(i.roomId) && !fetching && (error ? forbidden : true);
|
||||
return !inaccessibleRoom;
|
||||
});
|
||||
}
|
||||
const [childItems, setChildItems] = useState([] as HierarchyItemRoom[] | undefined);
|
||||
useEffect(() => {
|
||||
let childItemsMut = roomItems?.filter((i) => !subspaces.has(i.roomId));
|
||||
if (!spacePermissions?.stateEvent(StateEvent.SpaceChild, mx.getSafeUserId())) {
|
||||
// hide unknown rooms for normal user
|
||||
childItemsMut = childItems?.filter((i) => {
|
||||
const forbidden = error instanceof MatrixError ? error.errcode === 'M_FORBIDDEN' : false;
|
||||
const inaccessibleRoom = !rooms.get(i.roomId) && !fetching && (error ? forbidden : true);
|
||||
return !inaccessibleRoom;
|
||||
});
|
||||
}
|
||||
setChildItems(childItemsMut);
|
||||
}, [childItems, spacePermissions, mx, roomItems, subspaces, fetching, error, rooms]);
|
||||
|
||||
return (
|
||||
<Box direction="Column" gap="0" ref={ref}>
|
||||
@@ -204,7 +208,7 @@ export const SpaceHierarchyItem = forwardRef<HTMLDivElement, SpaceHierarchyItemP
|
||||
</Box>
|
||||
) : (
|
||||
childItems && (
|
||||
<SequenceCard variant="SurfaceVariant" gap="300" alignItems="Center" radii="0">
|
||||
<SequenceCard variant="SurfaceVariant" gap="300" alignItems="Center" radii="300">
|
||||
<Box
|
||||
grow="Yes"
|
||||
style={{
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
import { forwardRef } from 'react';
|
||||
import { Room, IHierarchyRoom } from '$types/matrix-sdk';
|
||||
import { Box } from 'folds';
|
||||
import { HierarchyItem, HierarchyItemSpace } from '$hooks/useSpaceHierarchy';
|
||||
import { IPowerLevels } from '$hooks/usePowerLevels';
|
||||
import { useMatrixClient } from '$hooks/useMatrixClient';
|
||||
import { StateEvent } from '$types/matrix/room';
|
||||
import { getRoomCreatorsForRoomId } from '$hooks/useRoomCreators';
|
||||
import { getRoomPermissionsAPI } from '$hooks/useRoomPermissions';
|
||||
import { AfterItemDropTarget, CanDropCallback } from './DnD';
|
||||
import { HierarchyItemMenu } from './HierarchyItemMenu';
|
||||
import { SpaceNavItemCard } from './SpaceNavItem';
|
||||
|
||||
type SpaceHierarchyNavItemProps = {
|
||||
summary: IHierarchyRoom | undefined;
|
||||
spaceItem: HierarchyItemSpace;
|
||||
allJoinedRooms: Set<string>;
|
||||
roomsPowerLevels: Map<string, IPowerLevels>;
|
||||
categoryId: string;
|
||||
draggingItem?: HierarchyItem;
|
||||
onDragging: (item?: HierarchyItem) => void;
|
||||
canDrop: CanDropCallback;
|
||||
disabledReorder?: boolean;
|
||||
nextSpaceId?: string;
|
||||
pinned: boolean;
|
||||
togglePinToSidebar: (roomId: string) => void;
|
||||
getRoom: (roomId: string) => Room | undefined;
|
||||
};
|
||||
export const SpaceHierarchyNavItem = forwardRef<HTMLDivElement, SpaceHierarchyNavItemProps>(
|
||||
(
|
||||
{
|
||||
summary,
|
||||
spaceItem,
|
||||
allJoinedRooms,
|
||||
roomsPowerLevels,
|
||||
categoryId,
|
||||
draggingItem,
|
||||
onDragging,
|
||||
canDrop,
|
||||
disabledReorder,
|
||||
nextSpaceId,
|
||||
pinned,
|
||||
togglePinToSidebar,
|
||||
getRoom,
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
const mx = useMatrixClient();
|
||||
|
||||
const spacePowerLevels = roomsPowerLevels.get(spaceItem.roomId);
|
||||
|
||||
const draggingSpace =
|
||||
draggingItem?.roomId === spaceItem.roomId && draggingItem.parentId === spaceItem.parentId;
|
||||
|
||||
const { parentId } = spaceItem;
|
||||
const parentPowerLevels = parentId ? roomsPowerLevels.get(parentId) : undefined;
|
||||
const parentCreators = parentId ? getRoomCreatorsForRoomId(mx, parentId) : undefined;
|
||||
const parentPermissions =
|
||||
parentCreators &&
|
||||
parentPowerLevels &&
|
||||
getRoomPermissionsAPI(parentCreators, parentPowerLevels);
|
||||
|
||||
return (
|
||||
<Box direction="Column" gap="0" ref={ref}>
|
||||
<SpaceNavItemCard
|
||||
summary={summary}
|
||||
item={spaceItem}
|
||||
joined={allJoinedRooms.has(spaceItem.roomId)}
|
||||
categoryId={categoryId}
|
||||
canReorder={
|
||||
parentPowerLevels && !disabledReorder && parentPermissions
|
||||
? parentPermissions.stateEvent(StateEvent.SpaceChild, mx.getSafeUserId())
|
||||
: false
|
||||
}
|
||||
options={
|
||||
parentId &&
|
||||
parentPowerLevels && (
|
||||
<HierarchyItemMenu
|
||||
item={{ ...spaceItem, parentId }}
|
||||
powerLevels={spacePowerLevels}
|
||||
joined={allJoinedRooms.has(spaceItem.roomId)}
|
||||
canEditChild={
|
||||
!!parentPermissions?.stateEvent(StateEvent.SpaceChild, mx.getSafeUserId())
|
||||
}
|
||||
pinned={pinned}
|
||||
onTogglePin={togglePinToSidebar}
|
||||
/>
|
||||
)
|
||||
}
|
||||
getRoom={getRoom}
|
||||
after={
|
||||
<AfterItemDropTarget
|
||||
item={spaceItem}
|
||||
nextRoomId={nextSpaceId}
|
||||
afterSpace
|
||||
canDrop={canDrop}
|
||||
/>
|
||||
}
|
||||
onDragging={onDragging}
|
||||
data-dragging={draggingSpace}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -1,25 +1,5 @@
|
||||
import { MouseEventHandler, ReactNode, useCallback, useRef, useState } from 'react';
|
||||
import {
|
||||
Box,
|
||||
Avatar,
|
||||
Text,
|
||||
Chip,
|
||||
Icon,
|
||||
Icons,
|
||||
as,
|
||||
Badge,
|
||||
toRem,
|
||||
Spinner,
|
||||
PopOut,
|
||||
Menu,
|
||||
MenuItem,
|
||||
RectCords,
|
||||
config,
|
||||
IconButton,
|
||||
TooltipProvider,
|
||||
Tooltip,
|
||||
} from 'folds';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import { MouseEventHandler, ReactNode, useCallback, useRef } from 'react';
|
||||
import { Box, Avatar, Text, Chip, Icon, Icons, as, Badge, toRem, Spinner } from 'folds';
|
||||
import classNames from 'classnames';
|
||||
import { MatrixError, Room, IHierarchyRoom } from '$types/matrix-sdk';
|
||||
import { HierarchyItem } from '$hooks/useSpaceHierarchy';
|
||||
@@ -29,14 +9,8 @@ import { nameInitials } from '$utils/common';
|
||||
import { LocalRoomSummaryLoader } from '$components/RoomSummaryLoader';
|
||||
import { getRoomAvatarUrl } from '$utils/room';
|
||||
import { AsyncStatus, useAsyncCallback } from '$hooks/useAsyncCallback';
|
||||
import { stopPropagation } from '$utils/keyboard';
|
||||
import { mxcUrlToHttp } from '$utils/matrix';
|
||||
import { useMediaAuthentication } from '$hooks/useMediaAuthentication';
|
||||
import { useOpenCreateRoomModal } from '$state/hooks/createRoomModal';
|
||||
import { useOpenCreateSpaceModal } from '$state/hooks/createSpaceModal';
|
||||
import { CreateRoomType } from '$components/create-room/types';
|
||||
import { AddExistingModal } from '$features/add-existing';
|
||||
import { BetaNoticeBadge } from '$components/BetaNoticeBadge';
|
||||
import { useDraggableItem } from './DnD';
|
||||
import * as styleCss from './style.css';
|
||||
import * as css from './SpaceItem.css';
|
||||
@@ -60,7 +34,7 @@ type InaccessibleSpaceProfileProps = {
|
||||
roomId: string;
|
||||
suggested?: boolean;
|
||||
};
|
||||
function InaccessibleSpaceProfile({ roomId, suggested }: InaccessibleSpaceProfileProps) {
|
||||
export function InaccessibleSpaceProfile({ roomId, suggested }: InaccessibleSpaceProfileProps) {
|
||||
return (
|
||||
<Chip
|
||||
as="span"
|
||||
@@ -105,7 +79,7 @@ type UnjoinedSpaceProfileProps = {
|
||||
avatarUrl?: string;
|
||||
suggested?: boolean;
|
||||
};
|
||||
function UnjoinedSpaceProfile({
|
||||
export function UnjoinedSpaceProfile({
|
||||
roomId,
|
||||
via,
|
||||
name,
|
||||
@@ -244,204 +218,205 @@ function RootSpaceProfile({ closed, categoryId, handleClose }: RootSpaceProfileP
|
||||
);
|
||||
}
|
||||
|
||||
function AddRoomButton({ item }: { item: HierarchyItem }) {
|
||||
const [cords, setCords] = useState<RectCords>();
|
||||
const openCreateRoomModal = useOpenCreateRoomModal();
|
||||
const [addExisting, setAddExisting] = useState(false);
|
||||
// Keeping this dead code here until I figure out how to add it into the HierarchyItemMenu...
|
||||
// function AddRoomButton({ item }: { item: HierarchyItem }) {
|
||||
// const [cords, setCords] = useState<RectCords>();
|
||||
// const openCreateRoomModal = useOpenCreateRoomModal();
|
||||
// const [addExisting, setAddExisting] = useState(false);
|
||||
|
||||
const handleAddRoom: MouseEventHandler<HTMLButtonElement> = (evt) => {
|
||||
setCords(evt.currentTarget.getBoundingClientRect());
|
||||
};
|
||||
// const handleAddRoom: MouseEventHandler<HTMLButtonElement> = (evt) => {
|
||||
// setCords(evt.currentTarget.getBoundingClientRect());
|
||||
// };
|
||||
|
||||
const handleCreateRoom = (type?: CreateRoomType) => {
|
||||
openCreateRoomModal(item.roomId, type);
|
||||
setCords(undefined);
|
||||
};
|
||||
// const handleCreateRoom = (type?: CreateRoomType) => {
|
||||
// openCreateRoomModal(item.roomId, type);
|
||||
// setCords(undefined);
|
||||
// };
|
||||
|
||||
const handleAddExisting = () => {
|
||||
setAddExisting(true);
|
||||
setCords(undefined);
|
||||
};
|
||||
// const handleAddExisting = () => {
|
||||
// setAddExisting(true);
|
||||
// setCords(undefined);
|
||||
// };
|
||||
|
||||
return (
|
||||
<PopOut
|
||||
anchor={cords}
|
||||
position="Bottom"
|
||||
align="End"
|
||||
content={
|
||||
<FocusTrap
|
||||
focusTrapOptions={{
|
||||
initialFocus: false,
|
||||
onDeactivate: () => setCords(undefined),
|
||||
clickOutsideDeactivates: true,
|
||||
isKeyForward: (evt: KeyboardEvent) => evt.key === 'ArrowDown',
|
||||
isKeyBackward: (evt: KeyboardEvent) => evt.key === 'ArrowUp',
|
||||
escapeDeactivates: stopPropagation,
|
||||
}}
|
||||
>
|
||||
<Menu style={{ padding: config.space.S100 }}>
|
||||
<MenuItem
|
||||
size="300"
|
||||
radii="300"
|
||||
variant="Primary"
|
||||
fill="None"
|
||||
onClick={() => handleCreateRoom(CreateRoomType.TextRoom)}
|
||||
>
|
||||
<Text size="T300">Chat Room</Text>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
size="300"
|
||||
radii="300"
|
||||
variant="Primary"
|
||||
fill="None"
|
||||
onClick={() => handleCreateRoom(CreateRoomType.VoiceRoom)}
|
||||
after={<BetaNoticeBadge />}
|
||||
>
|
||||
<Text size="T300">Voice Room</Text>
|
||||
</MenuItem>
|
||||
<MenuItem size="300" radii="300" fill="None" onClick={handleAddExisting}>
|
||||
<Text size="T300">Existing Room</Text>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</FocusTrap>
|
||||
}
|
||||
>
|
||||
{item.parentId === undefined ? (
|
||||
<Chip
|
||||
variant="Primary"
|
||||
radii="Pill"
|
||||
before={<Icon src={Icons.Plus} size="50" />}
|
||||
onClick={handleAddRoom}
|
||||
aria-pressed={!!cords}
|
||||
>
|
||||
<Text size="B300">Add Room</Text>
|
||||
</Chip>
|
||||
) : (
|
||||
<TooltipProvider
|
||||
position="Bottom"
|
||||
offset={4}
|
||||
tooltip={
|
||||
<Tooltip>
|
||||
<Text>Add Room</Text>
|
||||
</Tooltip>
|
||||
}
|
||||
>
|
||||
{(triggerRef) => (
|
||||
<IconButton
|
||||
ref={triggerRef}
|
||||
onClick={handleAddRoom}
|
||||
aria-pressed={!!cords}
|
||||
aria-label="Add Room"
|
||||
variant="Primary"
|
||||
fill="Soft"
|
||||
size="300"
|
||||
radii="300"
|
||||
>
|
||||
<Icon size="50" src={Icons.HashPlus} />
|
||||
</IconButton>
|
||||
)}
|
||||
</TooltipProvider>
|
||||
)}
|
||||
{addExisting && (
|
||||
<AddExistingModal parentId={item.roomId} requestClose={() => setAddExisting(false)} />
|
||||
)}
|
||||
</PopOut>
|
||||
);
|
||||
}
|
||||
// return (
|
||||
// <PopOut
|
||||
// anchor={cords}
|
||||
// position="Bottom"
|
||||
// align="End"
|
||||
// content={
|
||||
// <FocusTrap
|
||||
// focusTrapOptions={{
|
||||
// initialFocus: false,
|
||||
// onDeactivate: () => setCords(undefined),
|
||||
// clickOutsideDeactivates: true,
|
||||
// isKeyForward: (evt: KeyboardEvent) => evt.key === 'ArrowDown',
|
||||
// isKeyBackward: (evt: KeyboardEvent) => evt.key === 'ArrowUp',
|
||||
// escapeDeactivates: stopPropagation,
|
||||
// }}
|
||||
// >
|
||||
// <Menu style={{ padding: config.space.S100 }}>
|
||||
// <MenuItem
|
||||
// size="300"
|
||||
// radii="300"
|
||||
// variant="Primary"
|
||||
// fill="None"
|
||||
// onClick={() => handleCreateRoom(CreateRoomType.TextRoom)}
|
||||
// >
|
||||
// <Text size="T300">Chat Room</Text>
|
||||
// </MenuItem>
|
||||
// <MenuItem
|
||||
// size="300"
|
||||
// radii="300"
|
||||
// variant="Primary"
|
||||
// fill="None"
|
||||
// onClick={() => handleCreateRoom(CreateRoomType.VoiceRoom)}
|
||||
// after={<BetaNoticeBadge />}
|
||||
// >
|
||||
// <Text size="T300">Voice Room</Text>
|
||||
// </MenuItem>
|
||||
// <MenuItem size="300" radii="300" fill="None" onClick={handleAddExisting}>
|
||||
// <Text size="T300">Existing Room</Text>
|
||||
// </MenuItem>
|
||||
// </Menu>
|
||||
// </FocusTrap>
|
||||
// }
|
||||
// >
|
||||
// {item.parentId === undefined ? (
|
||||
// <Chip
|
||||
// variant="Primary"
|
||||
// radii="Pill"
|
||||
// before={<Icon src={Icons.Plus} size="50" />}
|
||||
// onClick={handleAddRoom}
|
||||
// aria-pressed={!!cords}
|
||||
// >
|
||||
// <Text size="B300">Add Room</Text>
|
||||
// </Chip>
|
||||
// ) : (
|
||||
// <TooltipProvider
|
||||
// position="Bottom"
|
||||
// offset={4}
|
||||
// tooltip={
|
||||
// <Tooltip>
|
||||
// <Text>Add Room</Text>
|
||||
// </Tooltip>
|
||||
// }
|
||||
// >
|
||||
// {(triggerRef) => (
|
||||
// <IconButton
|
||||
// ref={triggerRef}
|
||||
// onClick={handleAddRoom}
|
||||
// aria-pressed={!!cords}
|
||||
// aria-label="Add Room"
|
||||
// variant="Primary"
|
||||
// fill="Soft"
|
||||
// size="300"
|
||||
// radii="300"
|
||||
// >
|
||||
// <Icon size="50" src={Icons.HashPlus} />
|
||||
// </IconButton>
|
||||
// )}
|
||||
// </TooltipProvider>
|
||||
// )}
|
||||
// {addExisting && (
|
||||
// <AddExistingModal parentId={item.roomId} requestClose={() => setAddExisting(false)} />
|
||||
// )}
|
||||
// </PopOut>
|
||||
// );
|
||||
// }
|
||||
|
||||
function AddSpaceButton({ item }: { item: HierarchyItem }) {
|
||||
const [cords, setCords] = useState<RectCords>();
|
||||
const openCreateSpaceModal = useOpenCreateSpaceModal();
|
||||
const [addExisting, setAddExisting] = useState(false);
|
||||
// function AddSpaceButton({ item }: { item: HierarchyItem }) {
|
||||
// const [cords, setCords] = useState<RectCords>();
|
||||
// const openCreateSpaceModal = useOpenCreateSpaceModal();
|
||||
// const [addExisting, setAddExisting] = useState(false);
|
||||
|
||||
const handleAddSpace: MouseEventHandler<HTMLButtonElement> = (evt) => {
|
||||
setCords(evt.currentTarget.getBoundingClientRect());
|
||||
};
|
||||
// const handleAddSpace: MouseEventHandler<HTMLButtonElement> = (evt) => {
|
||||
// setCords(evt.currentTarget.getBoundingClientRect());
|
||||
// };
|
||||
|
||||
const handleCreateSpace = () => {
|
||||
openCreateSpaceModal(item.roomId as any);
|
||||
setCords(undefined);
|
||||
};
|
||||
// const handleCreateSpace = () => {
|
||||
// openCreateSpaceModal(item.roomId as any);
|
||||
// setCords(undefined);
|
||||
// };
|
||||
|
||||
const handleAddExisting = () => {
|
||||
setAddExisting(true);
|
||||
setCords(undefined);
|
||||
};
|
||||
return (
|
||||
<PopOut
|
||||
anchor={cords}
|
||||
position="Bottom"
|
||||
align="End"
|
||||
content={
|
||||
<FocusTrap
|
||||
focusTrapOptions={{
|
||||
initialFocus: false,
|
||||
onDeactivate: () => setCords(undefined),
|
||||
clickOutsideDeactivates: true,
|
||||
isKeyForward: (evt: KeyboardEvent) => evt.key === 'ArrowDown',
|
||||
isKeyBackward: (evt: KeyboardEvent) => evt.key === 'ArrowUp',
|
||||
escapeDeactivates: stopPropagation,
|
||||
}}
|
||||
>
|
||||
<Menu style={{ padding: config.space.S100 }}>
|
||||
<MenuItem
|
||||
size="300"
|
||||
radii="300"
|
||||
variant="Primary"
|
||||
fill="None"
|
||||
onClick={handleCreateSpace}
|
||||
>
|
||||
<Text size="T300">New Space</Text>
|
||||
</MenuItem>
|
||||
<MenuItem size="300" radii="300" fill="None" onClick={handleAddExisting}>
|
||||
<Text size="T300">Existing Space</Text>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</FocusTrap>
|
||||
}
|
||||
>
|
||||
{item.parentId === undefined ? (
|
||||
<Chip
|
||||
variant="SurfaceVariant"
|
||||
radii="Pill"
|
||||
before={<Icon src={Icons.Plus} size="50" />}
|
||||
onClick={handleAddSpace}
|
||||
aria-pressed={!!cords}
|
||||
>
|
||||
<Text size="B300">Add Space</Text>
|
||||
</Chip>
|
||||
) : (
|
||||
<TooltipProvider
|
||||
position="Bottom"
|
||||
offset={4}
|
||||
tooltip={
|
||||
<Tooltip>
|
||||
<Text>Add Space</Text>
|
||||
</Tooltip>
|
||||
}
|
||||
>
|
||||
{(triggerRef) => (
|
||||
<IconButton
|
||||
ref={triggerRef}
|
||||
onClick={handleAddSpace}
|
||||
aria-pressed={!!cords}
|
||||
aria-label="Add Space"
|
||||
variant="SurfaceVariant"
|
||||
fill="None"
|
||||
size="300"
|
||||
radii="300"
|
||||
>
|
||||
<Icon size="50" src={Icons.SpacePlus} />
|
||||
</IconButton>
|
||||
)}
|
||||
</TooltipProvider>
|
||||
)}
|
||||
{addExisting && (
|
||||
<AddExistingModal space parentId={item.roomId} requestClose={() => setAddExisting(false)} />
|
||||
)}
|
||||
</PopOut>
|
||||
);
|
||||
}
|
||||
// const handleAddExisting = () => {
|
||||
// setAddExisting(true);
|
||||
// setCords(undefined);
|
||||
// };
|
||||
// return (
|
||||
// <PopOut
|
||||
// anchor={cords}
|
||||
// position="Bottom"
|
||||
// align="End"
|
||||
// content={
|
||||
// <FocusTrap
|
||||
// focusTrapOptions={{
|
||||
// initialFocus: false,
|
||||
// onDeactivate: () => setCords(undefined),
|
||||
// clickOutsideDeactivates: true,
|
||||
// isKeyForward: (evt: KeyboardEvent) => evt.key === 'ArrowDown',
|
||||
// isKeyBackward: (evt: KeyboardEvent) => evt.key === 'ArrowUp',
|
||||
// escapeDeactivates: stopPropagation,
|
||||
// }}
|
||||
// >
|
||||
// <Menu style={{ padding: config.space.S100 }}>
|
||||
// <MenuItem
|
||||
// size="300"
|
||||
// radii="300"
|
||||
// variant="Primary"
|
||||
// fill="None"
|
||||
// onClick={handleCreateSpace}
|
||||
// >
|
||||
// <Text size="T300">New Space</Text>
|
||||
// </MenuItem>
|
||||
// <MenuItem size="300" radii="300" fill="None" onClick={handleAddExisting}>
|
||||
// <Text size="T300">Existing Space</Text>
|
||||
// </MenuItem>
|
||||
// </Menu>
|
||||
// </FocusTrap>
|
||||
// }
|
||||
// >
|
||||
// {item.parentId === undefined ? (
|
||||
// <Chip
|
||||
// variant="SurfaceVariant"
|
||||
// radii="Pill"
|
||||
// before={<Icon src={Icons.Plus} size="50" />}
|
||||
// onClick={handleAddSpace}
|
||||
// aria-pressed={!!cords}
|
||||
// >
|
||||
// <Text size="B300">Add Space</Text>
|
||||
// </Chip>
|
||||
// ) : (
|
||||
// <TooltipProvider
|
||||
// position="Bottom"
|
||||
// offset={4}
|
||||
// tooltip={
|
||||
// <Tooltip>
|
||||
// <Text>Add Space</Text>
|
||||
// </Tooltip>
|
||||
// }
|
||||
// >
|
||||
// {(triggerRef) => (
|
||||
// <IconButton
|
||||
// ref={triggerRef}
|
||||
// onClick={handleAddSpace}
|
||||
// aria-pressed={!!cords}
|
||||
// aria-label="Add Space"
|
||||
// variant="SurfaceVariant"
|
||||
// fill="None"
|
||||
// size="300"
|
||||
// radii="300"
|
||||
// >
|
||||
// <Icon size="50" src={Icons.SpacePlus} />
|
||||
// </IconButton>
|
||||
// )}
|
||||
// </TooltipProvider>
|
||||
// )}
|
||||
// {addExisting && (
|
||||
// <AddExistingModal space parentId={item.roomId} requestClose={() => setAddExisting(false)} />
|
||||
// )}
|
||||
// </PopOut>
|
||||
// );
|
||||
// }
|
||||
|
||||
type SpaceItemCardProps = {
|
||||
summary: IHierarchyRoom | undefined;
|
||||
@@ -556,12 +531,6 @@ export const SpaceItemCard = as<'div', SpaceItemCardProps>(
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
{space && canEditChild && (
|
||||
<Box shrink="No" alignItems="Inherit" gap="200">
|
||||
<AddRoomButton item={item} />
|
||||
<AddSpaceButton item={item} />
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
{options}
|
||||
{after}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { style } from '@vanilla-extract/css';
|
||||
import { config, toRem } from 'folds';
|
||||
import { recipe } from '@vanilla-extract/recipes';
|
||||
|
||||
export const SpaceItemCard = recipe({
|
||||
base: {
|
||||
paddingBottom: config.space.S100,
|
||||
borderBottom: `${config.borderWidth.B300} solid transparent`,
|
||||
position: 'relative',
|
||||
selectors: {
|
||||
'&[data-dragging=true]': {
|
||||
opacity: config.opacity.Disabled,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
export const HeaderChip = style({
|
||||
paddingLeft: config.space.S200,
|
||||
selectors: {
|
||||
[`&[data-ui-before="true"]`]: {
|
||||
paddingLeft: config.space.S100,
|
||||
},
|
||||
},
|
||||
});
|
||||
export const HeaderChipPlaceholder = style([
|
||||
{
|
||||
borderRadius: config.radii.R400,
|
||||
paddingLeft: config.space.S100,
|
||||
paddingRight: config.space.S300,
|
||||
height: toRem(32),
|
||||
},
|
||||
]);
|
||||
@@ -0,0 +1,173 @@
|
||||
import { ReactNode, useRef } from 'react';
|
||||
import { Avatar, Badge, Box, Chip, Icon, Icons, as, Text } from 'folds';
|
||||
import classNames from 'classnames';
|
||||
import { IHierarchyRoom, MatrixClient, Room } from '$types/matrix-sdk';
|
||||
import { useMatrixClient } from '$hooks/useMatrixClient';
|
||||
import { getCanonicalAliasOrRoomId, mxcUrlToHttp } from '$utils/matrix';
|
||||
import { useMediaAuthentication } from '$hooks/useMediaAuthentication';
|
||||
import { HierarchyItem } from '$hooks/useSpaceHierarchy';
|
||||
import { LocalRoomSummaryLoader } from '$components/RoomSummaryLoader';
|
||||
import { getRoomAvatarUrl } from '$utils/room';
|
||||
import { RoomAvatar } from '$components/room-avatar';
|
||||
import { nameInitials } from '$utils/common';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { getSpaceLobbyPath } from '$pages/pathUtils';
|
||||
import { InaccessibleSpaceProfile, UnjoinedSpaceProfile } from './SpaceItem';
|
||||
import * as css from './SpaceNavItem.css';
|
||||
import { useDraggableItem } from './DnD';
|
||||
|
||||
type SpaceProfileProps = {
|
||||
roomId: string;
|
||||
name: string;
|
||||
avatarUrl?: string;
|
||||
suggested?: boolean;
|
||||
categoryId: string;
|
||||
mx: MatrixClient;
|
||||
};
|
||||
function SpaceNavProfile({
|
||||
roomId,
|
||||
name,
|
||||
avatarUrl,
|
||||
suggested,
|
||||
categoryId,
|
||||
mx,
|
||||
}: SpaceProfileProps) {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<Chip
|
||||
data-category-id={categoryId}
|
||||
className={css.HeaderChip}
|
||||
variant="Surface"
|
||||
size="500"
|
||||
onClick={() => navigate(getSpaceLobbyPath(getCanonicalAliasOrRoomId(mx, roomId)))}
|
||||
before={
|
||||
<Avatar size="200" radii="300">
|
||||
<RoomAvatar
|
||||
roomId={roomId}
|
||||
src={avatarUrl}
|
||||
alt={name}
|
||||
renderFallback={() => (
|
||||
<Text as="span" size="H6">
|
||||
{nameInitials(name)}
|
||||
</Text>
|
||||
)}
|
||||
/>
|
||||
</Avatar>
|
||||
}
|
||||
after={<Icon src={Icons.Space} size="50" />}
|
||||
>
|
||||
<Box alignItems="Center" gap="200">
|
||||
<Text size="H4" truncate>
|
||||
{name}
|
||||
</Text>
|
||||
{suggested && (
|
||||
<Badge variant="Success" fill="Soft" radii="Pill" outlined>
|
||||
<Text size="L400">Suggested</Text>
|
||||
</Badge>
|
||||
)}
|
||||
</Box>
|
||||
</Chip>
|
||||
);
|
||||
}
|
||||
|
||||
type SpaceNavItemCardProps = {
|
||||
summary: IHierarchyRoom | undefined;
|
||||
item: HierarchyItem;
|
||||
joined?: boolean;
|
||||
categoryId: string;
|
||||
options?: ReactNode;
|
||||
before?: ReactNode;
|
||||
after?: ReactNode;
|
||||
canReorder: boolean;
|
||||
getRoom: (roomId: string) => Room | undefined;
|
||||
onDragging: (item?: HierarchyItem) => void;
|
||||
};
|
||||
export const SpaceNavItemCard = as<'div', SpaceNavItemCardProps>(
|
||||
(
|
||||
{
|
||||
className,
|
||||
summary,
|
||||
joined,
|
||||
categoryId,
|
||||
item,
|
||||
options,
|
||||
before,
|
||||
after,
|
||||
canReorder,
|
||||
onDragging,
|
||||
getRoom,
|
||||
...props
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
const mx = useMatrixClient();
|
||||
const useAuthentication = useMediaAuthentication();
|
||||
const { roomId, content } = item;
|
||||
// const spaceNav = getRoom(roomId);
|
||||
const targetRef = useRef<HTMLDivElement>(null);
|
||||
useDraggableItem(item, targetRef, onDragging);
|
||||
const space = getRoom(item.roomId);
|
||||
|
||||
return (
|
||||
<Box
|
||||
shrink="No"
|
||||
alignItems="Center"
|
||||
gap="200"
|
||||
className={classNames(css.SpaceItemCard(), className)}
|
||||
{...props}
|
||||
ref={ref}
|
||||
>
|
||||
{before}
|
||||
<Box grow="Yes" gap="100" alignItems="Inherit" justifyContent="SpaceBetween">
|
||||
<Box ref={canReorder ? targetRef : null}>
|
||||
{space ? (
|
||||
<LocalRoomSummaryLoader room={space}>
|
||||
{(localSummary) => (
|
||||
<SpaceNavProfile
|
||||
roomId={roomId}
|
||||
name={localSummary.name}
|
||||
avatarUrl={getRoomAvatarUrl(mx, space, 96, useAuthentication)}
|
||||
suggested={content.suggested}
|
||||
categoryId={categoryId}
|
||||
mx={mx}
|
||||
/>
|
||||
)}
|
||||
</LocalRoomSummaryLoader>
|
||||
) : (
|
||||
<>
|
||||
{!summary && (
|
||||
<InaccessibleSpaceProfile
|
||||
roomId={item.roomId}
|
||||
suggested={item.content.suggested}
|
||||
/>
|
||||
)}
|
||||
{summary && (
|
||||
<UnjoinedSpaceProfile
|
||||
roomId={roomId}
|
||||
via={item.content.via}
|
||||
name={summary.name || summary.canonical_alias || roomId}
|
||||
avatarUrl={
|
||||
summary?.avatar_url
|
||||
? (mxcUrlToHttp(
|
||||
mx,
|
||||
summary.avatar_url,
|
||||
useAuthentication,
|
||||
96,
|
||||
96,
|
||||
'crop'
|
||||
) ?? undefined)
|
||||
: undefined
|
||||
}
|
||||
suggested={content.suggested}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
{options}
|
||||
{after}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -114,12 +114,13 @@ const getSpaceHierarchy = (
|
||||
rootSpaceId: string,
|
||||
spaceRooms: Set<string>,
|
||||
getRoom: (roomId: string) => Room | undefined,
|
||||
excludeRoom: (parentId: string, roomId: string, depth: number) => boolean,
|
||||
closedCategory: (spaceId: string) => boolean
|
||||
): SpaceHierarchy[] => {
|
||||
const spaceItems: HierarchyItemSpace[] = getHierarchySpaces(
|
||||
rootSpaceId,
|
||||
getRoom,
|
||||
() => false,
|
||||
excludeRoom,
|
||||
spaceRooms
|
||||
);
|
||||
|
||||
@@ -161,19 +162,20 @@ export const useSpaceHierarchy = (
|
||||
spaceId: string,
|
||||
spaceRooms: Set<string>,
|
||||
getRoom: (roomId: string) => Room | undefined,
|
||||
excludeRoom: (parentId: string, roomId: string, depth: number) => boolean,
|
||||
closedCategory: (spaceId: string) => boolean
|
||||
): SpaceHierarchy[] => {
|
||||
const mx = useMatrixClient();
|
||||
const roomToParents = useAtomValue(roomToParentsAtom);
|
||||
|
||||
const [hierarchyAtom] = useState(() =>
|
||||
atom(getSpaceHierarchy(spaceId, spaceRooms, getRoom, closedCategory))
|
||||
atom(getSpaceHierarchy(spaceId, spaceRooms, getRoom, excludeRoom, closedCategory))
|
||||
);
|
||||
const [hierarchy, setHierarchy] = useAtom(hierarchyAtom);
|
||||
|
||||
useEffect(() => {
|
||||
setHierarchy(getSpaceHierarchy(spaceId, spaceRooms, getRoom, closedCategory));
|
||||
}, [mx, spaceId, spaceRooms, setHierarchy, getRoom, closedCategory]);
|
||||
setHierarchy(getSpaceHierarchy(spaceId, spaceRooms, getRoom, excludeRoom, closedCategory));
|
||||
}, [mx, spaceId, spaceRooms, setHierarchy, getRoom, closedCategory, excludeRoom]);
|
||||
|
||||
useStateEventCallback(
|
||||
mx,
|
||||
@@ -184,10 +186,12 @@ export const useSpaceHierarchy = (
|
||||
if (!eventRoomId) return;
|
||||
|
||||
if (spaceId === eventRoomId || getAllParents(roomToParents, eventRoomId).has(spaceId)) {
|
||||
setHierarchy(getSpaceHierarchy(spaceId, spaceRooms, getRoom, closedCategory));
|
||||
setHierarchy(
|
||||
getSpaceHierarchy(spaceId, spaceRooms, getRoom, excludeRoom, closedCategory)
|
||||
);
|
||||
}
|
||||
},
|
||||
[spaceId, roomToParents, setHierarchy, spaceRooms, getRoom, closedCategory]
|
||||
[spaceId, roomToParents, setHierarchy, spaceRooms, getRoom, closedCategory, excludeRoom]
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user