diff --git a/frontend/src/ui/components/Dialog.tsx b/frontend/src/ui/components/Dialog.tsx index f7e1352..ae54ecb 100644 --- a/frontend/src/ui/components/Dialog.tsx +++ b/frontend/src/ui/components/Dialog.tsx @@ -38,5 +38,5 @@ export function MaterialDialog(props: FullDialogProps) { }; }, [dialogRef.current, props.open, props.onOpenChange]); - return ; + return ; } \ No newline at end of file diff --git a/frontend/src/ui/components/chat/LeftPanel.tsx b/frontend/src/ui/components/chat/LeftPanel.tsx index 5d24d6e..f56756c 100644 --- a/frontend/src/ui/components/chat/LeftPanel.tsx +++ b/frontend/src/ui/components/chat/LeftPanel.tsx @@ -4,21 +4,21 @@ import { useChat } from "../../hooks/useChat"; import defaultAvatar from "../../../resources/images/default-avatar.png"; import { useState } from "react"; import { ProfileDialog } from "../profile/ProfileDialog"; +import { SettingsDialog } from "../settings/SettingsDialog"; function BottomAppBar() { - const { openSettings } = useDialog(); - - const handleSettingsClick = () => { - openSettings(); - }; + const [settingsOpen, onSettingsOpenChange] = useState(false); return ( - - - - - - + <> + + onSettingsOpenChange(true)}> + + + + + + > ); } diff --git a/frontend/src/ui/components/settings/SettingsDialog.tsx b/frontend/src/ui/components/settings/SettingsDialog.tsx index f856526..d730950 100644 --- a/frontend/src/ui/components/settings/SettingsDialog.tsx +++ b/frontend/src/ui/components/settings/SettingsDialog.tsx @@ -1,9 +1,9 @@ import { useState } from "react"; -import { useDialog } from "../../contexts/DialogContext"; import { PRODUCT_NAME } from "../../../core/config"; +import type { DialogProps } from "../../../core/types"; +import { MaterialDialog } from "../Dialog"; -export function SettingsDialog() { - const { isSettingsOpen, closeSettings } = useDialog(); +export function SettingsDialog({ isOpen, onOpenChange }: DialogProps) { const [activePanel, setActivePanel] = useState("notifications-settings"); const handlePanelChange = (panelId: string) => { @@ -11,11 +11,11 @@ export function SettingsDialog() { }; return ( - + - + onOpenChange(false)}> Настройки @@ -148,6 +148,6 @@ export function SettingsDialog() { - + ); } diff --git a/frontend/src/ui/screen/ChatScreen.tsx b/frontend/src/ui/screen/ChatScreen.tsx index 416418d..2c6406b 100644 --- a/frontend/src/ui/screen/ChatScreen.tsx +++ b/frontend/src/ui/screen/ChatScreen.tsx @@ -1,21 +1,17 @@ import { ChatInterface } from "../components/chat/ChatInterface"; import { CropperDialog } from "../components/profile/CropperDialog"; -import { SettingsDialog } from "../components/settings/SettingsDialog"; import { MessageContextMenu } from "../components/chat/MessageContextMenu"; import { EditMessageDialog } from "../components/chat/EditMessageDialog"; import { ReplyMessageDialog } from "../components/chat/ReplyMessageDialog"; -import { UserProfileDialog } from "../components/chat/UserProfileDialog"; export default function ChatScreen() { return ( <> - - {}} /> > ); } \ No newline at end of file