diff --git a/frontend/src/ui/components/chat/BottomAppBar.tsx b/frontend/src/ui/components/chat/BottomAppBar.tsx index c0c7278..e69de29 100644 --- a/frontend/src/ui/components/chat/BottomAppBar.tsx +++ b/frontend/src/ui/components/chat/BottomAppBar.tsx @@ -1,18 +0,0 @@ -import { useDialog } from "../../contexts/DialogContext"; - -export function BottomAppBar() { - const { openSettings } = useDialog(); - - const handleSettingsClick = () => { - openSettings(); - }; - - return ( - - - -
- -
- ); -} diff --git a/frontend/src/ui/components/chat/ChatInterface.tsx b/frontend/src/ui/components/chat/ChatInterface.tsx index 44f7729..00ed776 100644 --- a/frontend/src/ui/components/chat/ChatInterface.tsx +++ b/frontend/src/ui/components/chat/ChatInterface.tsx @@ -1,12 +1,12 @@ -import { ChatList } from "./ChatList"; -import { ChatContainer } from "./ChatContainer"; +import { LeftPanel } from "./LeftPanel"; +import { RightPanel } from "./RightPanel"; export function ChatInterface() { return (
- - + +
); diff --git a/frontend/src/ui/components/chat/ChatList.tsx b/frontend/src/ui/components/chat/ChatList.tsx deleted file mode 100644 index 70887d7..0000000 --- a/frontend/src/ui/components/chat/ChatList.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { ChatHeader } from "./ChatHeader"; -import { ChatTabs } from "./ChatTabs"; -import { BottomAppBar } from "./BottomAppBar"; - -export function ChatList() { - return ( -
- - - -
- ); -} diff --git a/frontend/src/ui/components/chat/LeftPanel.tsx b/frontend/src/ui/components/chat/LeftPanel.tsx new file mode 100644 index 0000000..98b8712 --- /dev/null +++ b/frontend/src/ui/components/chat/LeftPanel.tsx @@ -0,0 +1,106 @@ +import { PRODUCT_NAME } from "../../../core/config"; +import { useDialog } from "../../contexts/DialogContext"; +import { useChat } from "../../hooks/useChat"; + +function BottomAppBar() { + const { openSettings } = useDialog(); + + const handleSettingsClick = () => { + openSettings(); + }; + + return ( + + + +
+ +
+ ); +} + + +function ChatTabs() { + const { activeTab, setActiveTab, setCurrentChat } = useChat(); + + const handleChatClick = (chatName: string) => { + setCurrentChat(chatName); + }; + + return ( +
+ setActiveTab(e.value)}> + + Чаты + + + Каналы + + + Контакты + + + ЛС + + + + + handleChatClick("Общий чат")} + style={{ cursor: "pointer" }} + > + + + handleChatClick("Общий чат 2")} + style={{ cursor: "pointer" }} + > + + + + + Скоро будет... + Скоро будет... + + + + +
+ ); +} + + +function ChatHeader() { + const { openProfile } = useDialog(); + + const handleProfileClick = () => { + openProfile(); + }; + + return ( +
+
{PRODUCT_NAME}
+
+ + + +
+
+ ); +} + +export function LeftPanel() { + return ( +
+ + + +
+ ); +} diff --git a/frontend/src/ui/components/chat/ChatContainer.tsx b/frontend/src/ui/components/chat/RightPanel.tsx similarity index 80% rename from frontend/src/ui/components/chat/ChatContainer.tsx rename to frontend/src/ui/components/chat/RightPanel.tsx index c1f8c6e..8f4fd7d 100644 --- a/frontend/src/ui/components/chat/ChatContainer.tsx +++ b/frontend/src/ui/components/chat/RightPanel.tsx @@ -1,6 +1,6 @@ import { ChatMain } from "./ChatMain"; -export function ChatContainer() { +export function RightPanel() { return (
diff --git a/frontend/src/ui/screen/ChatScreen.tsx b/frontend/src/ui/screen/ChatScreen.tsx index 44093d5..18101d1 100644 --- a/frontend/src/ui/screen/ChatScreen.tsx +++ b/frontend/src/ui/screen/ChatScreen.tsx @@ -11,6 +11,7 @@ export default function ChatScreen() { return ( <> +