diff --git a/src/app/hooks/useSpaceShortcut.js b/src/app/hooks/useSpaceShortcut.js
index 8dca2ba..a1710c6 100644
--- a/src/app/hooks/useSpaceShortcut.js
+++ b/src/app/hooks/useSpaceShortcut.js
@@ -5,16 +5,19 @@ import initMatrix from '../../client/initMatrix';
import cons from '../../client/state/cons';
export function useSpaceShortcut() {
- const { roomList } = initMatrix;
- const [spaceShortcut, setSpaceShortcut] = useState([...roomList.spaceShortcut]);
+ const { accountData } = initMatrix;
+ const [spaceShortcut, setSpaceShortcut] = useState([...accountData.spaceShortcut]);
useEffect(() => {
const onSpaceShortcutUpdated = () => {
- setSpaceShortcut([...roomList.spaceShortcut]);
+ setSpaceShortcut([...accountData.spaceShortcut]);
};
- roomList.on(cons.events.roomList.SPACE_SHORTCUT_UPDATED, onSpaceShortcutUpdated);
+ accountData.on(cons.events.accountData.SPACE_SHORTCUT_UPDATED, onSpaceShortcutUpdated);
return () => {
- roomList.removeListener(cons.events.roomList.SPACE_SHORTCUT_UPDATED, onSpaceShortcutUpdated);
+ accountData.removeListener(
+ cons.events.accountData.SPACE_SHORTCUT_UPDATED,
+ onSpaceShortcutUpdated,
+ );
};
}, []);
diff --git a/src/app/molecules/space-options/SpaceOptions.jsx b/src/app/molecules/space-options/SpaceOptions.jsx
index cb69e18..223ff57 100644
--- a/src/app/molecules/space-options/SpaceOptions.jsx
+++ b/src/app/molecules/space-options/SpaceOptions.jsx
@@ -5,10 +5,13 @@ import { twemojify } from '../../../util/twemojify';
import initMatrix from '../../../client/initMatrix';
import { openSpaceSettings, openSpaceManage, openInviteUser } from '../../../client/action/navigation';
-import { leave, createSpaceShortcut, deleteSpaceShortcut } from '../../../client/action/room';
+import { leave } from '../../../client/action/room';
+import { createSpaceShortcut, deleteSpaceShortcut } from '../../../client/action/accountData';
import { MenuHeader, MenuItem } from '../../atoms/context-menu/ContextMenu';
+import CategoryIC from '../../../../public/res/ic/outlined/category.svg';
+import CategoryFilledIC from '../../../../public/res/ic/filled/category.svg';
import AddUserIC from '../../../../public/res/ic/outlined/add-user.svg';
import SettingsIC from '../../../../public/res/ic/outlined/settings.svg';
import HashSearchIC from '../../../../public/res/ic/outlined/hash-search.svg';
@@ -20,7 +23,7 @@ function SpaceOptions({ roomId, afterOptionSelect }) {
const mx = initMatrix.matrixClient;
const room = mx.getRoom(roomId);
const canInvite = room?.canInvite(mx.getUserId());
- const isPinned = initMatrix.roomList.spaceShortcut.has(roomId);
+ const isPinned = initMatrix.accountData.spaceShortcut.has(roomId);
const handleInviteClick = () => {
openInviteUser(roomId);
@@ -31,7 +34,10 @@ function SpaceOptions({ roomId, afterOptionSelect }) {
else createSpaceShortcut(roomId);
afterOptionSelect();
};
-
+ const handleCategorizeClick = () => {
+ alert('categorize');
+ afterOptionSelect();
+ };
const handleSettingsClick = () => {
openSpaceSettings(roomId);
afterOptionSelect();
@@ -51,6 +57,12 @@ function SpaceOptions({ roomId, afterOptionSelect }) {
return (
{twemojify(`Options for ${initMatrix.matrixClient.getRoom(roomId)?.name}`)}
+