diff --git a/.storybook/preview.ts b/.storybook/preview.ts index d6c54c6..febe81d 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -3,7 +3,6 @@ import '../src/styles/variables.css'; const preview: Preview = { parameters: { - actions: { argTypesRegex: '^on[A-Z].*' }, controls: { matchers: { color: /(background|color)$/i, @@ -11,19 +10,19 @@ const preview: Preview = { }, }, backgrounds: { - options: { - light: { name: 'light', value: '#f5f5f5' }, - dark: { name: 'dark', value: '#1a1a2e' }, - white: { name: 'white', value: '#ffffff' } - } + values: [ + { name: 'light', value: '#f5f5f5' }, + { name: 'dark', value: '#1a1a2e' }, + { name: 'white', value: '#ffffff' }, + ], }, }, initialGlobals: { backgrounds: { - value: 'light' - } - } + value: '#f5f5f5', + }, + }, }; export default preview; diff --git a/src/components/ChatWidget/ChatWidget.tsx b/src/components/ChatWidget/ChatWidget.tsx index 355526e..5094f8d 100644 --- a/src/components/ChatWidget/ChatWidget.tsx +++ b/src/components/ChatWidget/ChatWidget.tsx @@ -325,6 +325,7 @@ export const ChatWidget: React.FC = ({ onStartChat={handleStartChat} onNavigate={handleNavigate} currentPage="home" + onClose={isInline ? undefined : handleClose} /> ) : ( void; onNavigate: (page: 'home' | 'messages') => void; currentPage: 'home' | 'messages'; + onClose?: () => void; } export const HomePage: React.FC = ({ @@ -24,6 +25,7 @@ export const HomePage: React.FC = ({ onStartChat, onNavigate, currentPage, + onClose, }) => { const handleHomeCardClick = () => { if (homeLink) { @@ -36,15 +38,35 @@ export const HomePage: React.FC = ({
-
- {agentLogoUrl ? ( - {agentName} - ) : ( -
- -
+
+
+ {agentLogoUrl ? ( + {agentName} + ) : ( +
+ +
+ )} + {agentName} +
+ {onClose && ( + )} - {agentName}