From a058bf118d37981e123c42aaa1a28f18d4a857cb Mon Sep 17 00:00:00 2001 From: martincupela Date: Tue, 9 Sep 2025 07:02:13 +0200 Subject: [PATCH] fix: export LoadingChannel component --- src/components/Channel/Channel.tsx | 6 +- .../Channel/__tests__/Channel.test.js | 1 + .../__snapshots__/Channel.test.js.snap | 216 +----------------- .../{Channel => Loading}/LoadingChannel.tsx | 0 src/components/Loading/index.ts | 1 + 5 files changed, 10 insertions(+), 214 deletions(-) rename src/components/{Channel => Loading}/LoadingChannel.tsx (100%) diff --git a/src/components/Channel/Channel.tsx b/src/components/Channel/Channel.tsx index 3f25746a43..e11f46016c 100644 --- a/src/components/Channel/Channel.tsx +++ b/src/components/Channel/Channel.tsx @@ -41,8 +41,10 @@ import type { OnMentionAction } from './hooks/useMentionsHandlers'; import { useMentionsHandlers } from './hooks/useMentionsHandlers'; import type { LoadingErrorIndicatorProps } from '../Loading'; -import { LoadingErrorIndicator as DefaultLoadingErrorIndicator } from '../Loading'; -import { LoadingChannel as DefaultLoadingIndicator } from './LoadingChannel'; +import { + LoadingErrorIndicator as DefaultLoadingErrorIndicator, + LoadingChannel as DefaultLoadingIndicator, +} from '../Loading'; import type { ChannelActionContextValue, diff --git a/src/components/Channel/__tests__/Channel.test.js b/src/components/Channel/__tests__/Channel.test.js index 74fbf5ed28..2d9139bc48 100644 --- a/src/components/Channel/__tests__/Channel.test.js +++ b/src/components/Channel/__tests__/Channel.test.js @@ -35,6 +35,7 @@ import { DEFAULT_THREAD_PAGE_SIZE } from '../../../constants/limits'; import { generateMessageDraft } from '../../../mock-builders/generator/messageDraft'; jest.mock('../../Loading', () => ({ + LoadingChannel: jest.fn(() =>
Loading channel
), LoadingErrorIndicator: jest.fn(() =>
), LoadingIndicator: jest.fn(() =>
loading
), })); diff --git a/src/components/Channel/__tests__/__snapshots__/Channel.test.js.snap b/src/components/Channel/__tests__/__snapshots__/Channel.test.js.snap index e8de2adff1..6818c4fe8b 100644 --- a/src/components/Channel/__tests__/__snapshots__/Channel.test.js.snap +++ b/src/components/Channel/__tests__/__snapshots__/Channel.test.js.snap @@ -6,112 +6,8 @@ exports[`Channel should render a LoadingIndicator if it is loading 1`] = ` class="str-chat messaging light str-chat__channel" id="str-chat__channel" > -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Loading channel
@@ -123,112 +19,8 @@ exports[`Channel should render default loading indicator if channels query is in class="str-chat str-chat__channel" id="str-chat__channel" > -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Loading channel
diff --git a/src/components/Channel/LoadingChannel.tsx b/src/components/Loading/LoadingChannel.tsx similarity index 100% rename from src/components/Channel/LoadingChannel.tsx rename to src/components/Loading/LoadingChannel.tsx diff --git a/src/components/Loading/index.ts b/src/components/Loading/index.ts index 05ceb99b69..75b5c332f4 100644 --- a/src/components/Loading/index.ts +++ b/src/components/Loading/index.ts @@ -1,3 +1,4 @@ +export * from './LoadingChannel'; export * from './LoadingChannels'; export * from './LoadingErrorIndicator'; export * from './LoadingIndicator';