monorepo-microservice-rbac/apps/aorta/src/App.tsx

38 lines
974 B
TypeScript
Raw Normal View History

2023-08-27 14:37:59 +08:00
import { DomainServiceProvider } from "./context/domainService";
import { defaultLang, theme } from "./constant";
import { useTracker } from "./hook/useTracker";
import { RouterElements } from "./router";
2023-09-07 13:41:32 +08:00
import { ConfigProvider, App as AntApp } from "antd";
2023-08-27 14:37:59 +08:00
import { useI18n } from "@tavi/i18n";
import "./styles/app.less";
2023-09-07 13:41:32 +08:00
import { useEffect } from "react";
import { antdUtils } from "./AntdUtils";
2023-08-27 14:37:59 +08:00
/**
*
*/
export const { i18n } = useI18n({
loadPath: "/locales/{{lng}}/{{ns}}.json",
fallbackLng: defaultLang,
debug: false,
});
export const App = () => {
useTracker();
2023-09-07 13:41:32 +08:00
const { notification, message, modal } = AntApp.useApp();
useEffect(() => {
antdUtils
.setMessageInstance(message)
.setModalInstance(modal)
.setNotificationInstance(notification);
}, []);
2023-08-27 14:37:59 +08:00
return (
<DomainServiceProvider>
<ConfigProvider theme={theme}>
<RouterElements />
</ConfigProvider>
</DomainServiceProvider>
);
};