feat(phone/side-drawer): Common side drawer component

Still WIP, current implementation in AppWrapper is not permanent
This commit is contained in:
Taso committed 2021-04-01 14:09:41 -04:00
1 parent 289207beb9
commit 7c05ef39c7
3 files changed
+163 -2

No files matched your search

+46 -2
View File
@@ -1,9 +1,46 @@
import React from 'react';
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);
export const AppWrapper = ({ children, style, handleClickAway, ...props }: AppWrapperTypes) => {
return (
<div
ref={ref}
{...props}
style={{
padding: 0,
@@ -17,6 +54,13 @@ export const AppWrapper = ({ children, style, handleClickAway, ...props }: AppWr
...style,
}}
>
<PhoneDrawer
open={open}
handleClose={() => setOpen(false)}
appTitle={'Side Menu Thing'}
containerEl={ref.current}
items={items}
/>
{children}
</div>
);