From b5b5547927d16dd29a8cebd801d0b99b86c6d51b Mon Sep 17 00:00:00 2001 From: denis0001-dev Date: Sat, 18 Oct 2025 13:32:04 +0300 Subject: [PATCH] Implement profile dialog --- .cursor/rules/docs.mdc | 3 +- frontend/src/core/components/RichTextArea.tsx | 10 +- frontend/src/pages/chat/css/_message.scss | 67 ++- .../src/pages/chat/css/_profile-dialog.scss | 387 ++++++++---------- frontend/src/pages/chat/css/chat.scss | 4 +- .../src/pages/chat/css/cropper-dialog.scss | 51 +++ frontend/src/pages/chat/state.ts | 31 ++ frontend/src/pages/chat/ui/ProfileDialog.tsx | 347 ++++++++++++++++ .../src/pages/chat/ui/left/ChatHeader.tsx | 20 +- .../chat/ui/left/profile/CropperDialog.tsx | 2 + .../chat/ui/left/profile/ProfileDialog.tsx | 179 -------- .../src/pages/chat/ui/right/ChatMessages.tsx | 36 -- frontend/src/pages/chat/ui/right/Message.tsx | 57 +-- .../chat/ui/right/MessagePanelRenderer.tsx | 21 +- .../pages/chat/ui/right/UserProfileDialog.tsx | 71 ---- .../src/pages/chat/ui/right/panels/DMPanel.ts | 25 +- .../chat/ui/right/panels/MessagePanel.ts | 4 +- .../chat/ui/right/panels/PublicChatPanel.ts | 10 +- 18 files changed, 735 insertions(+), 590 deletions(-) create mode 100644 frontend/src/pages/chat/css/cropper-dialog.scss create mode 100644 frontend/src/pages/chat/ui/ProfileDialog.tsx delete mode 100644 frontend/src/pages/chat/ui/left/profile/ProfileDialog.tsx delete mode 100644 frontend/src/pages/chat/ui/right/UserProfileDialog.tsx diff --git a/.cursor/rules/docs.mdc b/.cursor/rules/docs.mdc index 4b13faf..a3125d3 100644 --- a/.cursor/rules/docs.mdc +++ b/.cursor/rules/docs.mdc @@ -1,6 +1,5 @@ --- -description: Documentation rules -alwaysApply: false +alwaysApply: true --- When documenting this project, follow these rules: diff --git a/frontend/src/core/components/RichTextArea.tsx b/frontend/src/core/components/RichTextArea.tsx index 8fb44e0..c2854a6 100644 --- a/frontend/src/core/components/RichTextArea.tsx +++ b/frontend/src/core/components/RichTextArea.tsx @@ -10,6 +10,7 @@ interface RichTextAreaProps { className?: string; rows?: number; autoComplete?: string; + readOnly?: boolean; } export function RichTextArea({ @@ -21,6 +22,7 @@ export function RichTextArea({ className, rows = 1, autoComplete = "off", + readOnly = false }: RichTextAreaProps) { const textareaRef = useRef(null); const hiddenTextareaRef = useRef(null); @@ -183,10 +185,10 @@ export function RichTextArea({ value={text} placeholder={placeholder} rows={rows} - autoComplete={autoComplete} - onChange={handleChange} - onKeyDown={handleKeyDown} - /> + autoComplete={readOnly ? "off" : autoComplete} + onChange={readOnly ? undefined : handleChange} + onKeyDown={readOnly ? undefined : handleKeyDown} + readOnly={readOnly} />