File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
libs/remix-ui/remix-ai-assistant/src/components Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export interface GroupListMenuProps {
6
6
choice : AiContextType | AiAssistantType | any
7
7
setShowOptions : Dispatch < React . SetStateAction < boolean > >
8
8
groupList : groupListType [ ]
9
+ themeTracker ?: any
9
10
}
10
11
11
12
export default function GroupListMenu ( props : GroupListMenuProps ) {
@@ -15,7 +16,7 @@ export default function GroupListMenu(props: GroupListMenuProps) {
15
16
{ props . groupList . map ( ( item , index ) => (
16
17
< button
17
18
key = { `${ item . label } -${ index } ` }
18
- className = " btn btn-light"
19
+ className = { ` btn btn-light ${ props . themeTracker ?. name === 'Dark' ? 'border border-dark' : '' } ` }
19
20
data-id = { item . dataId }
20
21
onClick = { ( ) => {
21
22
props . setChoice ( item . stateValue )
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ export const PromptArea: React.FC<PromptAreaProps> = ({
118
118
< div className = "btn-group btn-group-sm" role = "group" >
119
119
< button
120
120
type = "button"
121
- className = { `btn ${ aiMode === 'ask' ? 'btn-primary' : 'btn-outline-secondary' } px-2` }
121
+ className = { `btn btn-sm ${ aiMode === 'ask' ? 'btn-primary' : 'btn-outline-secondary' } px-2` }
122
122
onClick = { ( ) => {
123
123
setAiMode ( 'ask' )
124
124
_paq . push ( [ 'trackEvent' , 'remixAI' , 'ModeSwitch' , 'ask' ] )
@@ -129,7 +129,7 @@ export const PromptArea: React.FC<PromptAreaProps> = ({
129
129
</ button >
130
130
< button
131
131
type = "button"
132
- className = { `btn ${ aiMode === 'edit' ? 'btn-primary' : 'btn-outline-secondary' } px-2` }
132
+ className = { `btn btn-sm ${ aiMode === 'edit' ? 'btn-primary' : 'btn-outline-secondary' } px-2` }
133
133
onClick = { ( ) => {
134
134
setAiMode ( 'edit' )
135
135
_paq . push ( [ 'trackEvent' , 'remixAI' , 'ModeSwitch' , 'edit' ] )
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export const RemixUiRemixAiAssistant = React.forwardRef<
52
52
const [ selectedModel , setSelectedModel ] = useState < string | null > ( null )
53
53
const [ isOllamaFailureFallback , setIsOllamaFailureFallback ] = useState ( false )
54
54
const [ aiMode , setAiMode ] = useState < 'ask' | 'edit' > ( 'ask' )
55
+ const [ themeTracker , setThemeTracker ] = useState ( null )
55
56
56
57
const historyRef = useRef < HTMLDivElement | null > ( null )
57
58
const modelBtnRef = useRef ( null )
@@ -205,6 +206,15 @@ export const RemixUiRemixAiAssistant = React.forwardRef<
205
206
// fetchAssistantChoice()
206
207
// }, [props.plugin])
207
208
209
+ useEffect ( ( ) => {
210
+ props . plugin . on ( 'theme' , 'themeChanged' , ( theme ) => {
211
+ setThemeTracker ( theme )
212
+ } )
213
+ return ( ) => {
214
+ props . plugin . off ( 'theme' , 'themeChanged' )
215
+ }
216
+ } )
217
+
208
218
// bubble messages up to parent
209
219
useEffect ( ( ) => {
210
220
props . onMessagesChange ?.( messages )
@@ -705,6 +715,7 @@ export const RemixUiRemixAiAssistant = React.forwardRef<
705
715
setChoice = { handleModelSelection }
706
716
setShowOptions = { setShowModelOptions }
707
717
choice = { selectedModel }
718
+ themeTracker = { themeTracker }
708
719
groupList = { availableModels . map ( model => ( {
709
720
label : model ,
710
721
bodyText : `Use ${ model } model` ,
You can’t perform that action at this time.
0 commit comments