Files
new-phone-who-dis/phone/src/ui/components/AppWrapper.tsx
T
Taso 7c05ef39c7 feat(phone/side-drawer): Common side drawer component
Still WIP, current implementation in AppWrapper is not permanent
2021-04-01 14:09:41 -04:00

68 lines
1.3 KiB
TypeScript

import React, { createContext, useRef, useState } from 'react';
import { AppWrapperTypes } from '../interface/InterfaceUI';
import { Computer } from '@material-ui/icons';
import PhoneDrawer from './PhoneDrawer';
const items = [
{
onClick: () => console.log(),
icon: <Computer color="inherit" />,
text: 'Item Thing',
},
{
onClick: () => console.log(),
icon: <Computer color="inherit" />,
text: 'Item Thing',
},
{
onClick: () => console.log(),
icon: <Computer color="inherit" />,
text: 'Item Thing',
},
{
onClick: () => console.log(),
icon: <Computer color="inherit" />,
text: 'Item Thing',
},
];
export const AppWrapper = ({
children,
style,
handleClickAway,
sideMenu,
appName,
...props
}: AppWrapperTypes) => {
const ref = useRef();
const [open, setOpen] = useState(false);
return (
<div
ref={ref}
{...props}
style={{
padding: 0,
margin: 0,
width: '100%',
height: '100%',
display: 'flex',
position: 'relative',
flexDirection: 'column',
minHeight: '720px',
...style,
}}
>
<PhoneDrawer
open={open}
handleClose={() => setOpen(false)}
appTitle={'Side Menu Thing'}
containerEl={ref.current}
items={items}
/>
{children}
</div>
);
};