forked from module-federation/module-federation-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDashboardService.js
More file actions
66 lines (59 loc) · 1.63 KB
/
DashboardService.js
File metadata and controls
66 lines (59 loc) · 1.63 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { Container, Grid, makeStyles } from "@material-ui/core";
import React from "react";
import Widget from "./Widget";
import { useServiceContext } from "shell/Service";
const RecentOrders = React.lazy(() => import("order/RecentOrdersWidget"));
const SalesDeposits = React.lazy(() => import("sales/DepositsWidget"));
const SalesToday = React.lazy(() => import("sales/TodayWidget"));
const RecentOrderWidget = () => (
<Widget height="500px">
<RecentOrders />
</Widget>
);
const SalesDepositsWidget = () => (
<Widget height="240px">
<SalesDeposits />
</Widget>
);
const SalesTodayWidget = () => (
<Widget height="240px">
<SalesToday />
</Widget>
);
const useStyles = makeStyles((theme) => ({
appBarSpacer: theme.mixins.toolbar,
content: {
flexGrow: 1,
height: "100vh",
overflow: "auto",
},
container: {
paddingTop: theme.spacing(4),
paddingBottom: theme.spacing(4),
},
}));
export default function Dashboard() {
const classes = useStyles();
const serviceContext = useServiceContext();
React.useEffect(() => {
serviceContext.setService({ title: "Dashboard" });
}, []);
return (
<main className={classes.content}>
<div className={classes.appBarSpacer} />
<Container maxWidth="lg" className={classes.container}>
<Grid container spacing={3}>
<Grid item xs={12} md={8} lg={9}>
<SalesTodayWidget />
</Grid>
<Grid item xs={12} md={4} lg={3}>
<SalesDepositsWidget />
</Grid>
<Grid item xs={12}>
<RecentOrderWidget />
</Grid>
</Grid>
</Container>
</main>
);
}