chore: update detail styles

This commit is contained in:
steven
2022-08-27 08:57:29 +08:00
parent 62657f7f4e
commit 5bdf7654fc
14 changed files with 75 additions and 33 deletions

View File

@ -7,6 +7,7 @@ import * as storage from "./helpers/storage";
function App() {
const { setLocale } = useI18n();
const user = useAppSelector((state) => state.user.user);
const global = useAppSelector((state) => state.global);
const pathname = useAppSelector((state) => state.location.pathname);
const [isLoading, setLoading] = useState(true);
@ -21,12 +22,18 @@ function App() {
});
}, []);
useEffect(() => {
if (user?.setting.locale) {
globalService.setLocale(user.setting.locale);
}
}, [user?.setting.locale]);
useEffect(() => {
setLocale(global.locale);
storage.set({
locale: global.locale,
});
}, [global]);
}, [global.locale]);
return <>{isLoading ? null : appRouterSwitch(pathname)}</>;
}