-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathindex.tsx
More file actions
31 lines (30 loc) · 952 Bytes
/
index.tsx
File metadata and controls
31 lines (30 loc) · 952 Bytes
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
import navBackIcon from '@ui5/webcomponents-icons/dist/nav-back.js';
import { Button } from '@ui5/webcomponents-react/Button';
import { ShellBar } from '@ui5/webcomponents-react/ShellBar';
import { useRouter } from 'next/router';
import { ReactNode } from 'react';
import classes from './AppShell.module.css';
export function AppShell(props: { children: ReactNode }) {
const router = useRouter();
return (
<>
<div className={classes.appShell}>
<ShellBar
primaryTitle={'UI5 Web Components for React Examples'}
secondaryTitle={'NextJS - Pages Router'}
startButton={
router.asPath !== '/' && (
<Button
icon={navBackIcon}
onClick={() => {
router.back();
}}
/>
)
}
/>
<div className={classes.scrollContainer}>{props.children}</div>
</div>
</>
);
}