diff --git a/client/public/icons/drawer/arrow_back.svg b/client/public/icons/drawer/arrow_back.svg new file mode 100644 index 0000000..8f4a6dc --- /dev/null +++ b/client/public/icons/drawer/arrow_back.svg @@ -0,0 +1,3 @@ + + + diff --git a/client/public/icons/drawer/delete.svg b/client/public/icons/drawer/delete.svg new file mode 100644 index 0000000..e2c48d6 --- /dev/null +++ b/client/public/icons/drawer/delete.svg @@ -0,0 +1,3 @@ + + + diff --git a/client/src/components/ContentDrawer.tsx b/client/src/components/ContentDrawer.tsx new file mode 100644 index 0000000..5c83586 --- /dev/null +++ b/client/src/components/ContentDrawer.tsx @@ -0,0 +1,101 @@ +import { Drawer } from 'antd'; +import { useEffect, useState } from 'react'; +import { Avatar, Typography } from 'antd'; + +interface ContentDrawerProps { + open: boolean; + closeDrawer: () => void; + children: React.ReactNode; +} + +export default function ContentDrawer({ + open, + closeDrawer, + children, +}: ContentDrawerProps) { + const [width, setWidth] = useState('30%'); + + const calculateWidths = () => { + const windowWidth = window.innerWidth; + const expanded = Math.max(windowWidth * 0.3, 300); + setWidth(expanded); + }; + + useEffect(() => { + calculateWidths(); + window.addEventListener('resize', calculateWidths); + return () => window.removeEventListener('resize', calculateWidths); + }, []); + + const drawerTitle = ( + + + + + + + + + + Александр Александров + + + alexandralex@vorkout.ru + + + + + + + + + ); + + return ( + + {children} + + ); +} diff --git a/client/src/components/Header.tsx b/client/src/components/Header.tsx index 18a3b7b..1dd99bf 100644 --- a/client/src/components/Header.tsx +++ b/client/src/components/Header.tsx @@ -1,3 +1,4 @@ +import { Avatar } from 'antd'; import Title from 'antd/es/typography/Title'; interface HeaderProps { @@ -41,13 +42,9 @@ export default function Header({ title }: HeaderProps) { justifyContent: 'center', }} > -