diff --git a/src/app/components/RoomAccessIndicator.tsx b/src/app/components/RoomAccessIndicator.tsx
new file mode 100644
index 00000000..08716ddd
--- /dev/null
+++ b/src/app/components/RoomAccessIndicator.tsx
@@ -0,0 +1,41 @@
+import { Icon, Icons, IconSrc, Text, Tooltip, TooltipProvider } from 'folds';
+import React from 'react';
+import { JoinRule } from '../../types/matrix/room';
+import { useClient } from '../hooks/useClient';
+import { useObservableValue } from '../hooks/useObservableValue';
+import { useRoomJoinRuleLabel } from './JoinRulesSwitcher';
+
+export const getRoomAccessIconSrc = (joinRule?: JoinRule): IconSrc | undefined => {
+ if (!joinRule) return Icons.Lock;
+
+ if (joinRule === 'public') return Icons.Globe;
+ if (joinRule === 'invite' || joinRule === 'knock' || joinRule === 'private') {
+ return Icons.Lock;
+ }
+
+ return undefined;
+};
+
+export function RoomAccessIndicator({ roomId }: { roomId: string }) {
+ const ct = useClient();
+ const roomToJoinRule = useObservableValue(ct.roomToJoinRule);
+
+ const ruleToLabels = useRoomJoinRuleLabel();
+
+ const iconSrc = getRoomAccessIconSrc(roomToJoinRule.get(roomId));
+ if (!iconSrc) return null;
+
+ return (
+
+ {ruleToLabels[roomToJoinRule.get(roomId) ?? 'private']}
+
+ }
+ >
+ {(triggerRef) => }
+
+ );
+}
diff --git a/src/app/features/room/RoomViewHeader.tsx b/src/app/features/room/RoomViewHeader.tsx
index 26dacb10..20c2dadb 100644
--- a/src/app/features/room/RoomViewHeader.tsx
+++ b/src/app/features/room/RoomViewHeader.tsx
@@ -70,6 +70,7 @@ import {
import { roomToNotificationsAtom } from '../../state/room/roomToNotifications';
import { ContainerColor } from '../../styles/ContainerColor.css';
import { RoomSettingsPage } from '../../state/roomSettings';
+import { RoomAccessIndicator } from '../../components/RoomAccessIndicator';
type RoomMenuProps = {
requestClose: () => void;
@@ -352,9 +353,12 @@ export function RoomViewHeader({ callView }: { callView?: boolean }) {
)}
-
- {name}
-
+
+
+ {name}
+
+
+
{topic && (
{(viewTopic, setViewTopic) => (
diff --git a/src/app/pages/client/space/Space.tsx b/src/app/pages/client/space/Space.tsx
index 768fba50..dd023017 100644
--- a/src/app/pages/client/space/Space.tsx
+++ b/src/app/pages/client/space/Space.tsx
@@ -92,6 +92,7 @@ import { getJoinRoomStateId } from '../../../../client/storage/collections';
import { useAllJoinedRoomsSet } from '../../../hooks/useGetRoom';
import { unreadRoomsAtom } from '../../../state/room/roomToUnread';
import { useRoomsUnread } from '../../../state/hooks/unread';
+import { RoomAccessIndicator } from '../../../components/RoomAccessIndicator';
type SpaceMenuProps = {
requestClose: () => void;
@@ -239,11 +240,8 @@ type SpaceHeaderProps = {
spaceName: string;
};
function SpaceHeader({ spaceName }: SpaceHeaderProps) {
- const ct = useClient();
const spaceId = useSpace();
const [menuAnchor, setMenuAnchor] = useState();
- const roomToJoinRule = useObservableValue(ct.roomToJoinRule);
- const joinRule = roomToJoinRule.get(spaceId);
const handleOpenMenu: MouseEventHandler = (evt) => {
const cords = evt.currentTarget.getBoundingClientRect();
@@ -257,11 +255,11 @@ function SpaceHeader({ spaceName }: SpaceHeaderProps) {
<>
-
+
{spaceName}
- {joinRule !== 'public' && }
+