-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmodule.tsx
More file actions
executable file
·36 lines (32 loc) · 1.36 KB
/
module.tsx
File metadata and controls
executable file
·36 lines (32 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as React from 'react';
import { Layout, ConfigProvider } from 'antd';
import counterModules from '@sample-stack/counter-module-browser';
import { Feature, FeatureWithRouterFactory, sortKeys } from '@common-stack/client-react';
import { useRoutes } from "react-router-dom";
import { SiderMenu } from './layout';
import '@sample-stack/assets';
import { ErrorBoundary } from '../app/ErrorBoundary';
const features = new Feature(FeatureWithRouterFactory, counterModules);
export const MainRoute = (props) => {
const routes = useRoutes(features.getConfiguredRoutes());
return <ConfigProvider theme={{ hashed: false }}>
<ErrorBoundary>
<Layout hasSider={true} style={{ minHeight: '100vh', display: 'flex' }}>
<SiderMenu
collapsed={false}
menuData={features.getMenus()}
location={{ pathname: '/' } as any}
segments={features.sidebarSegments}
/>
<Layout>
<Layout.Content style={{ height: '100%' }}>
<section className="flex-grow" style={{ height: '100%' }}>
{routes}
</section>
</Layout.Content>
</Layout>
</Layout>
</ErrorBoundary>
</ConfigProvider>
}
export default features;