mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
feat(phone/side-drawer): Common side drawer component
Still WIP, current implementation in AppWrapper is not permanent
This commit is contained in:
1 parent
289207beb9
commit
7c05ef39c7
3 files changed
+163
-2
No files matched your search
@@ -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>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user