signoz/frontend/src/modules/BaseLayout.tsx
Palash gupta f070bdf5b9
feat(FE): add Not Found Route (#217)
* base layout is updated

* app wrapper is updated

* InstrumentationPage spell is corrected

* not found is updated

* not found component is updated

* changes are updated

* appwrapper is updated

* fix: removed the unwanted file

* fix: React.FC is removed

* fix: styles are imported under single file

* webpack config is updated

* webpack config is updated

* env is updated
2021-07-30 11:47:58 +05:30

40 lines
930 B
TypeScript

import React, { ReactNode, useEffect } from "react";
import { Layout } from "antd";
import SideNav from "./Nav/SideNav";
import TopNav from "./Nav/TopNav";
import { useLocation } from "react-router-dom";
import { useRoute } from "./RouteProvider";
const { Content, Footer } = Layout;
interface BaseLayoutProps {
children: ReactNode;
}
const BaseLayout: React.FC<BaseLayoutProps> = ({ children }) => {
const location = useLocation();
const { dispatch } = useRoute();
useEffect(() => {
dispatch({ type: "ROUTE_IS_LOADED", payload: location.pathname });
}, [location]);
return (
<Layout style={{ minHeight: "100vh" }}>
<SideNav />
<Layout className="site-layout">
<Content style={{ margin: "0 16px" }}>
<TopNav />
{children}
</Content>
<Footer style={{ textAlign: "center", fontSize: 10 }}>
SigNoz Inc. ©2020
</Footer>
</Layout>
</Layout>
);
};
export default BaseLayout;