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" : {

View File

@ -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 }) {