diff --git a/packages/react/src/views/ChatLayout/ChatLayout.js b/packages/react/src/views/ChatLayout/ChatLayout.js index f3b4262ac..e8d5f54fe 100644 --- a/packages/react/src/views/ChatLayout/ChatLayout.js +++ b/packages/react/src/views/ChatLayout/ChatLayout.js @@ -34,6 +34,12 @@ import UiKitContextualBar from '../ContextualBarBlock/uiKit/UiKitContextualBar'; import useUiKitStore from '../../store/uiKitStore'; const ChatLayout = () => { + + const [mode, setMode] = useState('light'); + const toggleTheme = () => { + setMode((prev) => (prev === 'light' ? 'dark' : 'light')); + }; + const messageListRef = useRef(null); const clearUnreadDividerRef = useRef(null); const { classNames, styleOverrides } = useComponentOverrides('ChatBody'); @@ -103,11 +109,33 @@ const ChatLayout = () => { css={styles.layout} style={{ ...styleOverrides, + position:'relative', + backgroundColor: mode === 'light' ? '#000' : '#fff', + color: mode === 'light' ? '#fff' : '#000', + border: '1px solid black', }} className={`ec-chat-layout ${classNames}`} onDragOver={(e) => handleDrag(e)} onDrop={(e) => handleDragDrop(e)} > + + {mode === 'light' ? '🌙 Dark' : '☀️ Light'} + state.showReportMessage); const messageToReport = useMessageStore((state) => state.messageToReport); const isMessageLoaded = useMessageStore((state) => state.isMessageLoaded); + + + const { theme } = useTheme(); const isMessageNewDay = (current, previous) => @@ -39,14 +42,26 @@ const MessageList = ({ margin: auto; `} > - - - {isMessageLoaded - ? 'No messages' - : 'Ready to chat? Login now to join the fun.'} - + {!isUserAuthenticated ? ( + <> + + Sign in to start the conversation. + + ) : !isMessageLoaded ? ( + <> + + Loading messages... + + ) : ( + <> + + No messages yet + + )} ) : ( + + <> {!hasMoreMessages && isUserAuthenticated && (