From 67125b230f4557686c140e0f37810191d2bfc77e Mon Sep 17 00:00:00 2001 From: cheykrym Date: Wed, 22 Oct 2025 04:43:38 +0300 Subject: [PATCH] new chat view --- yobble/Resources/Localizable.xcstrings | 3 -- yobble/Views/Chat/PrivateChatView.swift | 52 +++++++++---------------- 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/yobble/Resources/Localizable.xcstrings b/yobble/Resources/Localizable.xcstrings index 1a4cc10..02bcd40 100644 --- a/yobble/Resources/Localizable.xcstrings +++ b/yobble/Resources/Localizable.xcstrings @@ -270,9 +270,6 @@ }, "Вложение" : { - }, - "Вложения" : { - }, "Войти" : { "localizations" : { diff --git a/yobble/Views/Chat/PrivateChatView.swift b/yobble/Views/Chat/PrivateChatView.swift index 958bc2b..c1dcd3a 100644 --- a/yobble/Views/Chat/PrivateChatView.swift +++ b/yobble/Views/Chat/PrivateChatView.swift @@ -209,29 +209,27 @@ struct PrivateChatView: View { private var composer: some View { VStack(spacing: 10) { - Divider() - - HStack(spacing: 12) { - composerToolbarButton(systemName: "paperclip", label: NSLocalizedString("Вложения", comment: "")) { - // TODO: hook to attachments action - } - - composerModeButton(.chat) - composerModeButton(.stickers) - - Spacer(minLength: 0) - } - HStack(alignment: .bottom, spacing: 12) { - HStack(alignment: .center, spacing: 8) { - Image(systemName: inputTab.iconName) + + Button(action: { }) { // переключатель на стикеры + Image(systemName: "paperclip") + .font(.system(size: 18, weight: .semibold)) + .frame(width: 40, height: 40) .foregroundColor(.secondary) + } + + HStack(alignment: .center, spacing: 8) { TextField(inputTab.placeholder, text: $draftText, axis: .vertical) .lineLimit(1...4) .focused($isComposerFocused) .submitLabel(.send) .disabled(viewModel.isSending || currentUserId == nil) .onSubmit { sendCurrentMessage() } + Button(action: { }) { // переключатель на стикеры + Image(systemName: "face.smiling") + .font(.system(size: 18, weight: .semibold)) + .foregroundColor(.secondary) + } } .padding(.vertical, 10) .padding(.horizontal, 12) @@ -242,10 +240,8 @@ struct PrivateChatView: View { Button(action: { isVideoPreferred.toggle() }) { Image(systemName: isVideoPreferred ? "video.fill" : "mic.fill") .font(.system(size: 18, weight: .semibold)) - .foregroundColor(.accentColor) .frame(width: 40, height: 40) - .background(Color.accentColor.opacity(0.12)) - .clipShape(Circle()) + .foregroundColor(.secondary) } .buttonStyle(.plain) } else { @@ -280,21 +276,11 @@ struct PrivateChatView: View { .buttonStyle(.plain) } - private func composerToolbarButton(systemName: String, label: String, action: @escaping () -> Void) -> some View { - Button(action: action) { - VStack(spacing: 4) { - Image(systemName: systemName) - .font(.system(size: 16, weight: .medium)) - Text(label) - .font(.caption2) - } - .foregroundColor(.primary) - .frame(width: 64, height: 44) - .background(Color(.secondarySystemBackground)) - .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous)) - } - .buttonStyle(.plain) - } +// private func composerToolbarButton(systemName: String, action: @escaping () -> Void) -> some View { +// Button(action: action) { +// Image(systemName: systemName) +// .font(.system(size: 16, weight: .medium)) +// } private func composerModeButton(_ tab: ComposerTab) -> some View { Button(action: { inputTab = tab }) {