@@ -11,7 +11,6 @@ use crate::server::og::request::GetOGsForUserRequest;
11
11
use gloo_storage:: Storage ;
12
12
13
13
use crate :: theme:: Theme ;
14
- use crate :: theme:: THEME ;
15
14
use bson:: oid:: ObjectId ;
16
15
use chrono:: Utc ;
17
16
use dioxus:: prelude:: * ;
@@ -44,6 +43,7 @@ pub fn ChatPanel(conversation_id: Signal<ObjectId>, user_token: Signal<String>)
44
43
let mut ogs = use_signal ( Vec :: < OG > :: new) ;
45
44
let mut thinking = use_signal ( || false ) ;
46
45
let mut loading = use_signal ( || false ) ;
46
+ let theme = use_context :: < Signal < Theme > > ( ) ;
47
47
48
48
let _ = use_resource ( move || async move {
49
49
let now = Utc :: now ( ) . timestamp ( ) ;
@@ -159,7 +159,7 @@ pub fn ChatPanel(conversation_id: Signal<ObjectId>, user_token: Signal<String>)
159
159
div {
160
160
class: format!(
161
161
"flex flex-col h-full {}" ,
162
- if * THEME . read ( ) == Theme :: Dark { "bg-gray-900 text-white" } else { "bg-white text-gray-900" }
162
+ if theme ( ) == Theme :: Dark { "bg-gray-900 text-white" } else { "bg-white text-gray-900" }
163
163
) ,
164
164
165
165
div {
@@ -168,7 +168,7 @@ pub fn ChatPanel(conversation_id: Signal<ObjectId>, user_token: Signal<String>)
168
168
select {
169
169
class: format!(
170
170
"p-2 rounded-lg mb-2 md:mb-0 flex-grow w-full md:w-auto truncate {}" ,
171
- if * THEME . read ( ) == Theme :: Dark { "bg-gray-700 text-white" } else { "bg-gray-100 text-black" }
171
+ if theme ( ) == Theme :: Dark { "bg-gray-700 text-white" } else { "bg-gray-100 text-black" }
172
172
) ,
173
173
onchange: move |evt| handle_og_change( evt. value( ) ) ,
174
174
option { value: "" , "Select a og" } ,
@@ -184,7 +184,7 @@ pub fn ChatPanel(conversation_id: Signal<ObjectId>, user_token: Signal<String>)
184
184
input {
185
185
class: format!(
186
186
"flex-1 p-2 rounded-lg border w-full {}" ,
187
- if * THEME . read ( ) == Theme :: Dark { "bg-gray-700 text-white border-gray-600" } else { "border-gray-300" }
187
+ if theme ( ) == Theme :: Dark { "bg-gray-700 text-white border-gray-600" } else { "border-gray-300" }
188
188
) ,
189
189
r#type: "text" ,
190
190
placeholder: "Type your query here..." ,
0 commit comments