Skip to content

Commit

Permalink
Add theme to ChatView component
Browse files Browse the repository at this point in the history
  • Loading branch information
arnautov-anton committed Sep 10, 2024
1 parent b1718a7 commit f3d3181
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/ChatView/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useChatContext } from '../../context';

import type { PropsWithChildren } from 'react';
import type { Thread, ThreadManagerState } from 'stream-chat';
import clsx from 'clsx';

const availableChatViews = ['channels', 'threads'] as const;

Expand All @@ -25,11 +26,13 @@ export const ChatView = ({ children }: PropsWithChildren) => {
'channels',
);

const { theme } = useChatContext();

Check warning on line 29 in src/components/ChatView/ChatView.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/ChatView/ChatView.tsx#L29

Added line #L29 was not covered by tests

const value = useMemo(() => ({ activeChatView, setActiveChatView }), [activeChatView]);

return (
<ChatViewContext.Provider value={value}>
<div className='str-chat str-chat__chat-view'>{children}</div>
<div className={clsx('str-chat', theme, 'str-chat__chat-view')}>{children}</div>
</ChatViewContext.Provider>
);
};
Expand Down

0 comments on commit f3d3181

Please sign in to comment.