LFFE-25 Implementation of print layout and Printable Page
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import MenuIcon from "@mui/icons-material/Menu";
|
||||
import {AppBar, Box, Container, CssBaseline, IconButton, Stack, Toolbar, useTheme} from "@mui/material";
|
||||
import {AppBar, Box, Container, IconButton, Stack, Toolbar, useTheme} from "@mui/material";
|
||||
import ProfileMenu from "./ProfileMenu";
|
||||
|
||||
function Header({drawerWidth, handleDrawerToggle}) {
|
||||
@@ -7,7 +7,6 @@ function Header({drawerWidth, handleDrawerToggle}) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<CssBaseline/>
|
||||
<AppBar
|
||||
position="fixed"
|
||||
sx={{
|
||||
|
||||
47
src/components/layouts/Print/Header/index.jsx
Normal file
47
src/components/layouts/Print/Header/index.jsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import {AppBar, Button, Container, Stack, Toolbar, useTheme} from "@mui/material";
|
||||
import {useTranslations} from "next-intl";
|
||||
import {useRouter} from "next/router";
|
||||
|
||||
function Header({drawerWidth, handleDrawerToggle}) {
|
||||
const theme = useTheme();
|
||||
const t = useTranslations()
|
||||
const router = useRouter()
|
||||
|
||||
return (
|
||||
<AppBar
|
||||
position="fixed"
|
||||
sx={{
|
||||
width: '100%',
|
||||
displayPrint: 'none'
|
||||
}}
|
||||
>
|
||||
<Container maxWidth="xxl">
|
||||
<Toolbar
|
||||
disableGutters
|
||||
sx={{
|
||||
display: "flex",
|
||||
}}
|
||||
>
|
||||
<Stack
|
||||
direction="row"
|
||||
sx={{
|
||||
flex: 1,
|
||||
position: "relative",
|
||||
...theme.mixins.toolbar,
|
||||
}}
|
||||
>
|
||||
<Button onClick={() => router.back()} size={'large'} sx={{
|
||||
color: "inherit",
|
||||
}}>{t('button_back_to_previous')}</Button>
|
||||
</Stack>
|
||||
<Stack direction="row" spacing={4} justifyContent="flex-end" sx={{flex: 1}}>
|
||||
<Button onClick={() => print()} size={'large'} variant={'contained'}
|
||||
color={'secondary'}>{t('btn_print')}</Button>
|
||||
</Stack>
|
||||
</Toolbar>
|
||||
</Container>
|
||||
</AppBar>
|
||||
);
|
||||
}
|
||||
|
||||
export default Header;
|
||||
16
src/components/layouts/Print/index.jsx
Normal file
16
src/components/layouts/Print/index.jsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import Header from "@/components/layouts/Print/Header";
|
||||
import {Paper, Toolbar} from "@mui/material";
|
||||
|
||||
const Print = (props) => {
|
||||
return (
|
||||
<>
|
||||
<Header/>
|
||||
<Toolbar sx={{displayPrint: 'none'}}/>
|
||||
<Paper elevation={0} sx={{width: '100%', bgcolor: '#efefef'}}>
|
||||
{props.children}
|
||||
</Paper>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Print
|
||||
Reference in New Issue
Block a user