From 6e9394ec7ae548f805c4f8f5a6499090ea0c3d0e Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 10 Nov 2021 03:00:25 -0500 Subject: [PATCH] Use Unicode aware character-wise slicing (#159) --- src/app/atoms/avatar/Avatar.jsx | 2 +- src/app/molecules/image-upload/ImageUpload.jsx | 2 +- src/app/molecules/people-selector/PeopleSelector.jsx | 2 +- src/app/molecules/room-intro/RoomIntro.jsx | 2 +- src/app/molecules/room-selector/RoomSelector.jsx | 2 +- src/app/molecules/room-tile/RoomTile.jsx | 2 +- src/app/organisms/navigation/SideBar.jsx | 4 ++-- src/app/organisms/profile-viewer/ProfileViewer.jsx | 2 +- src/app/organisms/room/RoomViewContent.jsx | 2 +- src/app/organisms/room/RoomViewHeader.jsx | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/atoms/avatar/Avatar.jsx b/src/app/atoms/avatar/Avatar.jsx index 616cea6..950c9ba 100644 --- a/src/app/atoms/avatar/Avatar.jsx +++ b/src/app/atoms/avatar/Avatar.jsx @@ -29,7 +29,7 @@ function Avatar({ { iconSrc !== null ? - : text !== null && {text} + : text !== null && {[...text][0]} } ) diff --git a/src/app/molecules/image-upload/ImageUpload.jsx b/src/app/molecules/image-upload/ImageUpload.jsx index da79489..5beed72 100644 --- a/src/app/molecules/image-upload/ImageUpload.jsx +++ b/src/app/molecules/image-upload/ImageUpload.jsx @@ -48,7 +48,7 @@ function ImageUpload({ > diff --git a/src/app/molecules/people-selector/PeopleSelector.jsx b/src/app/molecules/people-selector/PeopleSelector.jsx index 5fff5c0..23c71f9 100644 --- a/src/app/molecules/people-selector/PeopleSelector.jsx +++ b/src/app/molecules/people-selector/PeopleSelector.jsx @@ -18,7 +18,7 @@ function PeopleSelector({ onClick={onClick} type="button" > - + {name} {peopleRole !== null && {peopleRole}} diff --git a/src/app/molecules/room-intro/RoomIntro.jsx b/src/app/molecules/room-intro/RoomIntro.jsx index e9ae6f5..315d561 100644 --- a/src/app/molecules/room-intro/RoomIntro.jsx +++ b/src/app/molecules/room-intro/RoomIntro.jsx @@ -17,7 +17,7 @@ function RoomIntro({ }) { return (
- +
{heading} {linkifyContent(desc)} diff --git a/src/app/molecules/room-selector/RoomSelector.jsx b/src/app/molecules/room-selector/RoomSelector.jsx index 47201a6..3367746 100644 --- a/src/app/molecules/room-selector/RoomSelector.jsx +++ b/src/app/molecules/room-selector/RoomSelector.jsx @@ -51,7 +51,7 @@ function RoomSelector({ content={( <>
diff --git a/src/app/organisms/navigation/SideBar.jsx b/src/app/organisms/navigation/SideBar.jsx index 35fe8f2..b93a6b5 100644 --- a/src/app/organisms/navigation/SideBar.jsx +++ b/src/app/organisms/navigation/SideBar.jsx @@ -70,7 +70,7 @@ function ProfileAvatarMenu() { tooltip={profile.displayName} imageSrc={profile.avatarUrl !== null ? mx.mxcUrlToHttp(profile.avatarUrl, 42, 42, 'crop') : null} bgColor={colorMXID(mx.getUserId())} - text={profile.displayName.slice(0, 1)} + text={profile.displayName} /> )} /> @@ -190,7 +190,7 @@ function SideBar() { tooltip={room.name} bgColor={colorMXID(room.roomId)} imageSrc={room.getAvatarUrl(initMatrix.matrixClient.baseUrl, 42, 42, 'crop') || null} - text={room.name.slice(0, 1)} + text={room.name} isUnread={notifications.hasNoti(sRoomId)} notificationCount={abbreviateNumber(notifications.getTotalNoti(sRoomId))} isAlert={notifications.getHighlightNoti(sRoomId) !== 0} diff --git a/src/app/organisms/profile-viewer/ProfileViewer.jsx b/src/app/organisms/profile-viewer/ProfileViewer.jsx index 191678a..590c6da 100644 --- a/src/app/organisms/profile-viewer/ProfileViewer.jsx +++ b/src/app/organisms/profile-viewer/ProfileViewer.jsx @@ -257,7 +257,7 @@ function ProfileViewer() {
diff --git a/src/app/organisms/room/RoomViewContent.jsx b/src/app/organisms/room/RoomViewContent.jsx index 170d25d..60bbca3 100644 --- a/src/app/organisms/room/RoomViewContent.jsx +++ b/src/app/organisms/room/RoomViewContent.jsx @@ -356,7 +356,7 @@ function RoomViewContent({