import('components/drafts/drafts_link/drafts_link')));
+const GlobalThreadsLink = makeAsyncComponent('GlobalThreadsLink', lazy(() => import('components/threading/global_threads_link')));
+const UnreadChannelIndicator = makeAsyncComponent('UnreadChannelIndicator', lazy(() => import('../unread_channel_indicator')));
+const UnreadChannels = makeAsyncComponent('UnreadChannels', lazy(() => import('../unread_channels')));
export function renderView(props: React.HTMLProps
) {
return (
@@ -318,7 +319,7 @@ export default class SidebarList extends React.PureComponent {
};
navigateChannelShortcut = (e: KeyboardEvent) => {
- if (e.altKey && !e.shiftKey && !e.ctrlKey && !e.metaKey && (Keyboard.isKeyPressed(e, Constants.KeyCodes.UP) || Keyboard.isKeyPressed(e, Constants.KeyCodes.DOWN))) {
+ if (e.altKey && !e.shiftKey && !e.ctrlKey && !e.metaKey && (isKeyPressed(e, Constants.KeyCodes.UP) || isKeyPressed(e, Constants.KeyCodes.DOWN))) {
e.preventDefault();
const staticPageIds = this.getDisplayedStaticPageIds();
@@ -328,24 +329,24 @@ export default class SidebarList extends React.PureComponent {
const curIndex = allIds.indexOf(curSelectedId);
let nextIndex;
- if (Keyboard.isKeyPressed(e, Constants.KeyCodes.DOWN)) {
+ if (isKeyPressed(e, Constants.KeyCodes.DOWN)) {
nextIndex = curIndex + 1;
} else {
nextIndex = curIndex - 1;
}
- const nextId = allIds[Utils.mod(nextIndex, allIds.length)];
+ const nextId = allIds[mod(nextIndex, allIds.length)];
this.navigateById(nextId);
if (nextIndex >= staticPageIds.length) {
this.scrollToChannel(nextId);
}
- } else if (Keyboard.cmdOrCtrlPressed(e) && e.shiftKey && Keyboard.isKeyPressed(e, Constants.KeyCodes.K)) {
+ } else if (cmdOrCtrlPressed(e) && e.shiftKey && isKeyPressed(e, Constants.KeyCodes.K)) {
this.props.handleOpenMoreDirectChannelsModal(e);
}
};
navigateUnreadChannelShortcut = (e: KeyboardEvent) => {
- if (e.altKey && e.shiftKey && !e.ctrlKey && !e.metaKey && (Keyboard.isKeyPressed(e, Constants.KeyCodes.UP) || Keyboard.isKeyPressed(e, Constants.KeyCodes.DOWN))) {
+ if (e.altKey && e.shiftKey && !e.ctrlKey && !e.metaKey && (isKeyPressed(e, Constants.KeyCodes.UP) || isKeyPressed(e, Constants.KeyCodes.DOWN))) {
e.preventDefault();
const allChannelIds = this.getDisplayedChannelIds();
@@ -360,13 +361,13 @@ export default class SidebarList extends React.PureComponent {
}
let direction = 0;
- if (Keyboard.isKeyPressed(e, Constants.KeyCodes.UP)) {
+ if (isKeyPressed(e, Constants.KeyCodes.UP)) {
direction = -1;
} else {
direction = 1;
}
- const nextIndex = ChannelUtils.findNextUnreadChannelId(
+ const nextIndex = findNextUnreadChannelId(
this.props.currentChannelId,
allChannelIds,
unreadChannelIds,
@@ -546,7 +547,7 @@ export default class SidebarList extends React.PureComponent {
/>
);
- const ariaLabel = Utils.localizeMessage('accessibility.sections.lhsList', 'channel sidebar region');
+ const ariaLabel = localizeMessage('accessibility.sections.lhsList', 'channel sidebar region');
return (
diff --git a/webapp/channels/src/components/sidebar_right_menu/constant.ts b/webapp/channels/src/components/sidebar_mobile_right_menu/constant.ts
similarity index 100%
rename from webapp/channels/src/components/sidebar_right_menu/constant.ts
rename to webapp/channels/src/components/sidebar_mobile_right_menu/constant.ts
diff --git a/webapp/channels/src/components/sidebar_right_menu/index.ts b/webapp/channels/src/components/sidebar_mobile_right_menu/index.ts
similarity index 86%
rename from webapp/channels/src/components/sidebar_right_menu/index.ts
rename to webapp/channels/src/components/sidebar_mobile_right_menu/index.ts
index bfc8329ce8..aa938152f8 100644
--- a/webapp/channels/src/components/sidebar_right_menu/index.ts
+++ b/webapp/channels/src/components/sidebar_mobile_right_menu/index.ts
@@ -11,7 +11,7 @@ import {getIsMobileView} from 'selectors/views/browser';
import type {GlobalState} from 'types/store';
-import SidebarRightMenu from './sidebar_right_menu';
+import SidebarMobileRightMenu from './sidebar_mobile_right_menu';
function mapStateToProps(state: GlobalState) {
const config = getConfig(state);
@@ -27,4 +27,4 @@ function mapStateToProps(state: GlobalState) {
};
}
-export default connect(mapStateToProps)(SidebarRightMenu);
+export default connect(mapStateToProps)(SidebarMobileRightMenu);
diff --git a/webapp/channels/src/components/sidebar_right_menu/sidebar_right_menu.tsx b/webapp/channels/src/components/sidebar_mobile_right_menu/sidebar_mobile_right_menu.tsx
similarity index 100%
rename from webapp/channels/src/components/sidebar_right_menu/sidebar_right_menu.tsx
rename to webapp/channels/src/components/sidebar_mobile_right_menu/sidebar_mobile_right_menu.tsx
diff --git a/webapp/channels/src/utils/performance_telemetry/element_identification.test.tsx b/webapp/channels/src/utils/performance_telemetry/element_identification.test.tsx
index 9407d7cdf9..542dc973df 100644
--- a/webapp/channels/src/utils/performance_telemetry/element_identification.test.tsx
+++ b/webapp/channels/src/utils/performance_telemetry/element_identification.test.tsx
@@ -131,7 +131,9 @@ describe('identifyElementRegion', () => {
},
);
- expect(identifyElementRegion(screen.getAllByText(channel.display_name)[0])).toEqual('channel_sidebar');
+ await waitFor(() => {
+ expect(identifyElementRegion(screen.getAllByText(channel.display_name)[0])).toEqual('channel_sidebar');
+ });
expect(identifyElementRegion(screen.getAllByText(channel.display_name)[1])).toEqual('channel_header');
expect(identifyElementRegion(screen.getAllByText(channel.header)[0])).toEqual('channel_header');