@@ -12,6 +12,9 @@ import {
1212 css ,
1313 Banner ,
1414 cx ,
15+ fontFamilies ,
16+ palette ,
17+ useDarkMode ,
1518} from '@mongodb-js/compass-components' ;
1619
1720const { ChatWindow } = LgChatChatWindow ;
@@ -34,6 +37,18 @@ const assistantChatStyles = css({
3437 } ,
3538} ) ;
3639
40+ const headerStyleDarkModeFixes = css ( {
41+ 'h1, h2, h3, h4, h5, h6' : {
42+ color : palette . gray . light2 ,
43+ } ,
44+ } ) ;
45+
46+ const headerStyleLightModeFixes = css ( {
47+ 'h1, h2, h3, h4, h5, h6' : {
48+ color : palette . black ,
49+ } ,
50+ } ) ;
51+
3752// TODO(COMPASS-9751): These are temporary patches to make the Assistant chat take the entire
3853// width and height of the drawer since Leafygreen doesn't support this yet.
3954const assistantChatFixesStyles = css ( {
@@ -49,9 +64,7 @@ const assistantChatFixesStyles = css({
4964 /** TODO(COMPASS-9751): We're adjusting styling of all the headers to a lower level than the default for chat, this should be updated in Leafygreen as well and removed from our end. */
5065 'h1, h2, h3, h4, h5, h6' : {
5166 margin : 'unset' ,
52- color : '#001E2B' ,
53- fontFamily :
54- "'Euclid Circular A','Helvetica Neue',Helvetica,Arial, sans-serif" ,
67+ fontFamily : fontFamilies . default ,
5568 } ,
5669 /** h4, h5, h6 -> body 1 styling */
5770 'h4, h5, h6' : {
@@ -92,6 +105,7 @@ const errorBannerWrapperStyles = css({
92105export const AssistantChat : React . FunctionComponent < AssistantChatProps > = ( {
93106 chat,
94107} ) => {
108+ const darkMode = useDarkMode ( ) ;
95109 const { messages, sendMessage, status, error, clearError } = useChat ( {
96110 chat,
97111 } ) ;
@@ -122,7 +136,11 @@ export const AssistantChat: React.FunctionComponent<AssistantChatProps> = ({
122136 return (
123137 < div
124138 data-testid = "assistant-chat"
125- className = { cx ( assistantChatFixesStyles , assistantChatStyles ) }
139+ className = { cx (
140+ assistantChatFixesStyles ,
141+ assistantChatStyles ,
142+ darkMode ? headerStyleDarkModeFixes : headerStyleLightModeFixes
143+ ) }
126144 style = { { height : '100%' , width : '100%' } }
127145 >
128146 < LeafyGreenChatProvider variant = { Variant . Compact } >
0 commit comments