mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-05 19:11:52 +00:00
Native data AI application framework based on AWEL+AGENT (#1152)
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: lcx01800250 <lcx01800250@alibaba-inc.com> Co-authored-by: licunxing <864255598@qq.com> Co-authored-by: Aralhi <xiaoping0501@gmail.com> Co-authored-by: xuyuan23 <643854343@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: hzh97 <2976151305@qq.com>
This commit is contained in:
@@ -33,25 +33,23 @@ function CssWrapper({ children }: { children: React.ReactElement }) {
|
||||
setMuiMode(mode);
|
||||
}, [mode]);
|
||||
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (ref?.current && mode) {
|
||||
ref?.current?.classList?.add(mode);
|
||||
if (mode) {
|
||||
document.body?.classList?.add(mode);
|
||||
if (mode === 'light') {
|
||||
ref?.current?.classList?.remove('dark');
|
||||
document.body?.classList?.remove('dark');
|
||||
} else {
|
||||
ref?.current?.classList?.remove('light');
|
||||
document.body?.classList?.remove('light');
|
||||
}
|
||||
}
|
||||
}, [ref, mode]);
|
||||
}, [mode]);
|
||||
|
||||
useEffect(() => {
|
||||
i18n.changeLanguage && i18n.changeLanguage(window.localStorage.getItem(STORAGE_LANG_KEY) || 'en');
|
||||
}, [i18n]);
|
||||
|
||||
return (
|
||||
<div ref={ref}>
|
||||
<div>
|
||||
<TopProgressBar />
|
||||
{children}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user