diff --git a/src/assets/icons/DownArrow.tsx b/src/assets/icons/DownArrow.tsx index 9603b08..c077a8b 100644 --- a/src/assets/icons/DownArrow.tsx +++ b/src/assets/icons/DownArrow.tsx @@ -1,6 +1,6 @@ import React from 'react'; -const DownArrow = () => { +const DownArrow = (props: React.SVGProps) => { return ( { height='1em' width='1em' xmlns='http://www.w3.org/2000/svg' + {...props} > diff --git a/src/assets/icons/MenuIcon.tsx b/src/assets/icons/MenuIcon.tsx new file mode 100644 index 0000000..ab8ecdf --- /dev/null +++ b/src/assets/icons/MenuIcon.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +const MenuIcon = (props: React.SVGProps) => { + return ( + + + + + + ); +}; + +export default MenuIcon; diff --git a/src/components/Chat/Chat.tsx b/src/components/Chat/Chat.tsx index fde63af..7ec9c86 100644 --- a/src/components/Chat/Chat.tsx +++ b/src/components/Chat/Chat.tsx @@ -1,12 +1,19 @@ import React from 'react'; +import useStore from '@store/store'; import ChatContent from './ChatContent'; import MobileBar from '../MobileBar'; import StopGeneratingButton from '@components/StopGeneratingButton/StopGeneratingButton'; const Chat = () => { + const hideSideMenu = useStore((state) => state.hideSideMenu); + return ( -
+
diff --git a/src/components/Chat/ChatContent/Message/Message.tsx b/src/components/Chat/ChatContent/Message/Message.tsx index 9536d88..05a6bd1 100644 --- a/src/components/Chat/ChatContent/Message/Message.tsx +++ b/src/components/Chat/ChatContent/Message/Message.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import useStore from '@store/store'; import Avatar from './Avatar'; import MessageContent from './MessageContent'; @@ -25,13 +26,21 @@ const Message = React.memo( messageIndex: number; sticky?: boolean; }) => { + const hideSideMenu = useStore((state) => state.hideSideMenu); + return (
-
+
{ + const hideSideMenu = useStore((state) => state.hideSideMenu); + const setHideSideMenu = useStore((state) => state.setHideSideMenu); + + useEffect(() => { + window.addEventListener('resize', () => { + if (window.innerWidth < 768) setHideSideMenu(true); + }); + }, []); + return ( <>