new chat view

This commit is contained in:
cheykrym 2025-10-22 04:43:38 +03:00
parent 44f7336c8d
commit 67125b230f
2 changed files with 19 additions and 36 deletions

View File

@ -270,9 +270,6 @@
}, },
"Вложение" : { "Вложение" : {
},
"Вложения" : {
}, },
"Войти" : { "Войти" : {
"localizations" : { "localizations" : {

View File

@ -209,29 +209,27 @@ struct PrivateChatView: View {
private var composer: some View { private var composer: some View {
VStack(spacing: 10) { VStack(spacing: 10) {
Divider() HStack(alignment: .bottom, spacing: 12) {
HStack(spacing: 12) { Button(action: { }) { // переключатель на стикеры
composerToolbarButton(systemName: "paperclip", label: NSLocalizedString("Вложения", comment: "")) { Image(systemName: "paperclip")
// TODO: hook to attachments action .font(.system(size: 18, weight: .semibold))
.frame(width: 40, height: 40)
.foregroundColor(.secondary)
} }
composerModeButton(.chat)
composerModeButton(.stickers)
Spacer(minLength: 0)
}
HStack(alignment: .bottom, spacing: 12) {
HStack(alignment: .center, spacing: 8) { HStack(alignment: .center, spacing: 8) {
Image(systemName: inputTab.iconName)
.foregroundColor(.secondary)
TextField(inputTab.placeholder, text: $draftText, axis: .vertical) TextField(inputTab.placeholder, text: $draftText, axis: .vertical)
.lineLimit(1...4) .lineLimit(1...4)
.focused($isComposerFocused) .focused($isComposerFocused)
.submitLabel(.send) .submitLabel(.send)
.disabled(viewModel.isSending || currentUserId == nil) .disabled(viewModel.isSending || currentUserId == nil)
.onSubmit { sendCurrentMessage() } .onSubmit { sendCurrentMessage() }
Button(action: { }) { // переключатель на стикеры
Image(systemName: "face.smiling")
.font(.system(size: 18, weight: .semibold))
.foregroundColor(.secondary)
}
} }
.padding(.vertical, 10) .padding(.vertical, 10)
.padding(.horizontal, 12) .padding(.horizontal, 12)
@ -242,10 +240,8 @@ struct PrivateChatView: View {
Button(action: { isVideoPreferred.toggle() }) { Button(action: { isVideoPreferred.toggle() }) {
Image(systemName: isVideoPreferred ? "video.fill" : "mic.fill") Image(systemName: isVideoPreferred ? "video.fill" : "mic.fill")
.font(.system(size: 18, weight: .semibold)) .font(.system(size: 18, weight: .semibold))
.foregroundColor(.accentColor)
.frame(width: 40, height: 40) .frame(width: 40, height: 40)
.background(Color.accentColor.opacity(0.12)) .foregroundColor(.secondary)
.clipShape(Circle())
} }
.buttonStyle(.plain) .buttonStyle(.plain)
} else { } else {
@ -280,21 +276,11 @@ struct PrivateChatView: View {
.buttonStyle(.plain) .buttonStyle(.plain)
} }
private func composerToolbarButton(systemName: String, label: String, action: @escaping () -> Void) -> some View { // private func composerToolbarButton(systemName: String, action: @escaping () -> Void) -> some View {
Button(action: action) { // Button(action: action) {
VStack(spacing: 4) { // Image(systemName: systemName)
Image(systemName: systemName) // .font(.system(size: 16, weight: .medium))
.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 composerModeButton(_ tab: ComposerTab) -> some View { private func composerModeButton(_ tab: ComposerTab) -> some View {
Button(action: { inputTab = tab }) { Button(action: { inputTab = tab }) {