99 css ,
1010 spacing ,
1111 useId ,
12+ uiColors ,
13+ withTheme ,
1214} from '@mongodb-js/compass-components' ;
1315import { createLoggerAndTelemetry } from '@mongodb-js/compass-logging' ;
1416
@@ -19,6 +21,14 @@ const toolbarStyles = css({
1921 justifyContent : 'space-between' ,
2022} ) ;
2123
24+ const titleStylesDark = css ( {
25+ color : uiColors . green . light2 ,
26+ } ) ;
27+
28+ const titleStylesLight = css ( {
29+ color : uiColors . green . dark2 ,
30+ } ) ;
31+
2232const toolbarActionStyles = css ( {
2333 display : 'flex' ,
2434 flexDirection : 'column' ,
@@ -41,15 +51,17 @@ type ToolbarProps = {
4151 showFavorites : ( ) => void ;
4252 collapse : ( ) => void ;
4353 } ; // Query history actions are not currently typed.
54+ darkMode ?: boolean ;
4455 onClose ?: ( ) => void ;
4556 showing : 'recent' | 'favorites' ;
4657} ;
4758
48- const Toolbar : React . FunctionComponent < ToolbarProps > = ( {
59+ function UnthemedToolbar ( {
4960 actions,
61+ darkMode,
5062 showing,
5163 onClose,
52- } ) => {
64+ } : ToolbarProps ) : React . ReactElement {
5365 const onViewSwitch = useCallback (
5466 ( label : 'recent' | 'favorites' ) => {
5567 if ( label === 'recent' ) {
@@ -78,7 +90,11 @@ const Toolbar: React.FunctionComponent<ToolbarProps> = ({
7890 return (
7991 < CompassComponentsToolbar className = { toolbarStyles } >
8092 < div className = { toolbarActionStyles } >
81- < Label id = { labelId } htmlFor = { controlId } >
93+ < Label
94+ className = { darkMode ? titleStylesDark : titleStylesLight }
95+ id = { labelId }
96+ htmlFor = { controlId }
97+ >
8298 Queries
8399 </ Label >
84100 < SegmentedControl
@@ -114,6 +130,8 @@ const Toolbar: React.FunctionComponent<ToolbarProps> = ({
114130 </ IconButton >
115131 </ CompassComponentsToolbar >
116132 ) ;
117- } ;
133+ }
134+
135+ const Toolbar = withTheme ( UnthemedToolbar ) ;
118136
119137export { Toolbar } ;
0 commit comments