From 674b346de68492757c6256cc6332cabd5f6e8ab5 Mon Sep 17 00:00:00 2001 From: Sledmore Date: Sat, 26 Mar 2022 15:57:11 +0000 Subject: [PATCH 1/2] Adds an action for showing the most popular groups --- .../groups/views/GroupInformationView.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/groups/views/GroupInformationView.tsx b/src/components/groups/views/GroupInformationView.tsx index 51ffceb7..124eb962 100644 --- a/src/components/groups/views/GroupInformationView.tsx +++ b/src/components/groups/views/GroupInformationView.tsx @@ -17,10 +17,10 @@ interface GroupInformationViewProps extends GridProps export const GroupInformationView: FC = props => { - const { groupInformation = null, onClose = null, overflow = 'hidden', ...rest } = props; + const { groupInformation = null, onClose = null, overflow = 'hidden', ...rest } = props; const isRealOwner = (groupInformation && (groupInformation.ownerName === GetSessionDataManager().userName)); - + const joinGroup = () => (groupInformation && TryJoinGroup(groupInformation.id)); const leaveGroup = () => @@ -69,7 +69,7 @@ export const GroupInformationView: FC = props => return; } - + joinGroup(); } @@ -92,9 +92,12 @@ export const GroupInformationView: FC = props => case 'furniture': CreateLinkEvent('catalog/open/' + CatalogPageName.GUILD_CUSTOM_FURNI); break; + case 'popular_groups': + CreateLinkEvent('navigator/search/groups'); + break; } }, [ groupInformation ]); - + if(!groupInformation) return null; return ( @@ -131,9 +134,9 @@ export const GroupInformationView: FC = props => handleAction('homeroom') }>{ LocalizeText('group.linktobase') } handleAction('furniture') }>{ LocalizeText('group.buyfurni') } - { LocalizeText('group.showgroups') } + handleAction('popular_groups') }>{ LocalizeText('group.showgroups') } - { (groupInformation.type !== GroupType.PRIVATE) && + { (groupInformation.type !== GroupType.PRIVATE) && } From 3f6f45ca8cbab129e81ec1a13ac199348ad173bf Mon Sep 17 00:00:00 2001 From: Layne Date: Sun, 27 Mar 2022 04:39:07 +0000 Subject: [PATCH 2/2] @experimental/freeflowchat --- src/api/utils/DoElementsOverlap.ts | 10 -- src/api/utils/index.ts | 1 - .../NavigatorRoomSettingsVipChatTabView.tsx | 6 +- .../widgets/chat/ChatWidgetMessageView.tsx | 31 +++- .../room/widgets/chat/ChatWidgetView.scss | 2 +- .../room/widgets/chat/ChatWidgetView.tsx | 141 +++++++++++++----- .../widgets/chat/common/DoChatsOverlap.ts | 7 + 7 files changed, 136 insertions(+), 62 deletions(-) delete mode 100644 src/api/utils/DoElementsOverlap.ts create mode 100644 src/components/room/widgets/chat/common/DoChatsOverlap.ts diff --git a/src/api/utils/DoElementsOverlap.ts b/src/api/utils/DoElementsOverlap.ts deleted file mode 100644 index f28b0c86..00000000 --- a/src/api/utils/DoElementsOverlap.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const DoElementsOverlap = (a: HTMLElement, b: HTMLElement) => -{ - const rectA = a.getBoundingClientRect(); - const rectB = b.getBoundingClientRect(); - - const ox = Math.abs(rectA.x - rectB.x) < (rectA.x < rectB.x ? rectB.width : rectA.width); - const oy = Math.abs(rectA.y - rectB.y) < (rectA.y < rectB.y ? rectB.height : rectA.height); - - return (ox && oy); -} diff --git a/src/api/utils/index.ts b/src/api/utils/index.ts index c63244a6..398758cb 100644 --- a/src/api/utils/index.ts +++ b/src/api/utils/index.ts @@ -1,6 +1,5 @@ export * from './CloneObject'; export * from './ColorUtils'; -export * from './DoElementsOverlap'; export * from './LocalizeBadgeDescription'; export * from './LocalizeBageName'; export * from './LocalizeFormattedNumber'; diff --git a/src/components/navigator/views/room-settings/NavigatorRoomSettingsVipChatTabView.tsx b/src/components/navigator/views/room-settings/NavigatorRoomSettingsVipChatTabView.tsx index cb6122bc..8ecb26eb 100644 --- a/src/components/navigator/views/room-settings/NavigatorRoomSettingsVipChatTabView.tsx +++ b/src/components/navigator/views/room-settings/NavigatorRoomSettingsVipChatTabView.tsx @@ -28,9 +28,9 @@ export const NavigatorRoomSettingsVipChatTabView: FC{LocalizeText('navigator.roomsettings.chat.mode.line.by.line')}