@@ -250,6 +261,7 @@ function AboutSection() {
export const tabText = {
APPEARANCE: 'Appearance',
NOTIFICATIONS: 'Notifications',
+ EMOJI: 'Emoji',
SECURITY: 'Security',
ABOUT: 'About',
};
@@ -263,6 +275,11 @@ const tabItems = [{
iconSrc: BellIC,
disabled: false,
render: () =>
,
+}, {
+ text: tabText.EMOJI,
+ iconSrc: EmojiIC,
+ disabled: false,
+ render: () =>
,
}, {
text: tabText.SECURITY,
iconSrc: LockIC,
diff --git a/src/app/organisms/settings/Settings.scss b/src/app/organisms/settings/Settings.scss
index dac53d7..d77e634 100644
--- a/src/app/organisms/settings/Settings.scss
+++ b/src/app/organisms/settings/Settings.scss
@@ -40,7 +40,8 @@
.settings-notifications,
.settings-security__card,
.settings-security .device-manage,
-.settings-about__card {
+.settings-about__card,
+.settings-emoji__card {
@extend .settings-window__card;
}
diff --git a/src/app/organisms/space-settings/SpaceSettings.jsx b/src/app/organisms/space-settings/SpaceSettings.jsx
index 4373599..2c9d6d4 100644
--- a/src/app/organisms/space-settings/SpaceSettings.jsx
+++ b/src/app/organisms/space-settings/SpaceSettings.jsx
@@ -25,6 +25,7 @@ import RoomVisibility from '../../molecules/room-visibility/RoomVisibility';
import RoomAliases from '../../molecules/room-aliases/RoomAliases';
import RoomPermissions from '../../molecules/room-permissions/RoomPermissions';
import RoomMembers from '../../molecules/room-members/RoomMembers';
+import RoomEmojis from '../../molecules/room-emojis/RoomEmojis';
import UserIC from '../../../../public/res/ic/outlined/user.svg';
import CrossIC from '../../../../public/res/ic/outlined/cross.svg';
@@ -35,6 +36,7 @@ import PinIC from '../../../../public/res/ic/outlined/pin.svg';
import PinFilledIC from '../../../../public/res/ic/filled/pin.svg';
import CategoryIC from '../../../../public/res/ic/outlined/category.svg';
import CategoryFilledIC from '../../../../public/res/ic/filled/category.svg';
+import EmojiIC from '../../../../public/res/ic/outlined/emoji.svg';
import { confirmDialog } from '../../molecules/confirm-dialog/ConfirmDialog';
import { useForceUpdate } from '../../hooks/useForceUpdate';
@@ -42,6 +44,7 @@ import { useForceUpdate } from '../../hooks/useForceUpdate';
const tabText = {
GENERAL: 'General',
MEMBERS: 'Members',
+ EMOJIS: 'Emojis',
PERMISSIONS: 'Permissions',
};
@@ -53,6 +56,10 @@ const tabItems = [{
iconSrc: UserIC,
text: tabText.MEMBERS,
disabled: false,
+}, {
+ iconSrc: EmojiIC,
+ text: tabText.EMOJIS,
+ disabled: false,
}, {
iconSrc: ShieldUserIC,
text: tabText.PERMISSIONS,
@@ -178,6 +185,7 @@ function SpaceSettings() {
{selectedTab.text === tabText.GENERAL && }
{selectedTab.text === tabText.MEMBERS && }
+ {selectedTab.text === tabText.EMOJIS && }
{selectedTab.text === tabText.PERMISSIONS && }
diff --git a/src/app/organisms/sticker-board/StickerBoard.jsx b/src/app/organisms/sticker-board/StickerBoard.jsx
new file mode 100644
index 0000000..53b7563
--- /dev/null
+++ b/src/app/organisms/sticker-board/StickerBoard.jsx
@@ -0,0 +1,88 @@
+/* eslint-disable jsx-a11y/click-events-have-key-events */
+/* eslint-disable jsx-a11y/no-static-element-interactions */
+import React from 'react';
+import PropTypes from 'prop-types';
+import './StickerBoard.scss';
+
+import initMatrix from '../../../client/initMatrix';
+import { getRelevantPacks } from '../emoji-board/custom-emoji';
+
+import Text from '../../atoms/text/Text';
+import ScrollView from '../../atoms/scroll/ScrollView';
+
+function StickerBoard({ roomId, onSelect }) {
+ const mx = initMatrix.matrixClient;
+ const room = mx.getRoom(roomId);
+
+ const parentIds = initMatrix.roomList.getAllParentSpaces(room.roomId);
+ const parentRooms = [...parentIds].map((id) => mx.getRoom(id));
+
+ const packs = getRelevantPacks(
+ mx,
+ [room, ...parentRooms],
+ ).filter((pack) => pack.getStickers().length !== 0);
+
+ function isTargetNotSticker(target) {
+ return target.classList.contains('sticker-board__sticker') === false;
+ }
+ function getStickerData(target) {
+ const mxc = target.getAttribute('data-mx-sticker');
+ const body = target.getAttribute('title');
+ const httpUrl = target.getAttribute('src');
+ return { mxc, body, httpUrl };
+ }
+ const handleOnSelect = (e) => {
+ if (isTargetNotSticker(e.target)) return;
+
+ const stickerData = getStickerData(e.target);
+ onSelect(stickerData);
+ };
+
+ const renderPack = (pack) => (
+