2021-08-26 11:50:47 +05:30
|
|
|
import { Layout } from 'antd';
|
2021-09-23 15:43:43 +05:30
|
|
|
import SideNav from 'components/SideNav';
|
2021-08-26 11:50:47 +05:30
|
|
|
import React, { ReactNode, useEffect } from 'react';
|
|
|
|
|
import { useLocation } from 'react-router-dom';
|
2021-05-16 18:35:50 +05:30
|
|
|
|
2021-08-26 11:50:47 +05:30
|
|
|
import TopNav from './Nav/TopNav';
|
|
|
|
|
import { useRoute } from './RouteProvider';
|
2021-05-23 14:15:13 +05:30
|
|
|
|
2021-05-16 18:35:50 +05:30
|
|
|
const { Content, Footer } = Layout;
|
|
|
|
|
|
|
|
|
|
interface BaseLayoutProps {
|
|
|
|
|
children: ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const BaseLayout: React.FC<BaseLayoutProps> = ({ children }) => {
|
2021-05-23 14:15:13 +05:30
|
|
|
const location = useLocation();
|
|
|
|
|
const { dispatch } = useRoute();
|
2021-09-06 22:04:43 +05:30
|
|
|
const currentYear = new Date().getFullYear();
|
2021-05-23 14:15:13 +05:30
|
|
|
|
|
|
|
|
useEffect(() => {
|
2021-08-26 11:50:47 +05:30
|
|
|
dispatch({ type: 'ROUTE_IS_LOADED', payload: location.pathname });
|
2021-09-23 15:43:43 +05:30
|
|
|
}, [location, dispatch]);
|
2021-05-23 14:15:13 +05:30
|
|
|
|
2021-05-16 18:35:50 +05:30
|
|
|
return (
|
2021-08-26 11:50:47 +05:30
|
|
|
<Layout style={{ minHeight: '100vh' }}>
|
2021-05-16 18:35:50 +05:30
|
|
|
<SideNav />
|
|
|
|
|
<Layout className="site-layout">
|
2021-08-26 11:50:47 +05:30
|
|
|
<Content style={{ margin: '0 16px' }}>
|
2021-05-16 18:35:50 +05:30
|
|
|
<TopNav />
|
|
|
|
|
{children}
|
|
|
|
|
</Content>
|
2021-08-26 11:50:47 +05:30
|
|
|
<Footer style={{ textAlign: 'center', fontSize: 10 }}>
|
2021-09-06 22:04:43 +05:30
|
|
|
SigNoz Inc. ©{currentYear}
|
2021-05-16 18:35:50 +05:30
|
|
|
</Footer>
|
|
|
|
|
</Layout>
|
|
|
|
|
</Layout>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default BaseLayout;
|