new chat view
This commit is contained in:
parent
44f7336c8d
commit
67125b230f
@ -270,9 +270,6 @@
|
||||
},
|
||||
"Вложение" : {
|
||||
|
||||
},
|
||||
"Вложения" : {
|
||||
|
||||
},
|
||||
"Войти" : {
|
||||
"localizations" : {
|
||||
|
||||
@ -209,29 +209,27 @@ struct PrivateChatView: View {
|
||||
|
||||
private var composer: some View {
|
||||
VStack(spacing: 10) {
|
||||
Divider()
|
||||
HStack(alignment: .bottom, spacing: 12) {
|
||||
|
||||
HStack(spacing: 12) {
|
||||
composerToolbarButton(systemName: "paperclip", label: NSLocalizedString("Вложения", comment: "")) {
|
||||
// TODO: hook to attachments action
|
||||
Button(action: { }) { // переключатель на стикеры
|
||||
Image(systemName: "paperclip")
|
||||
.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) {
|
||||
Image(systemName: inputTab.iconName)
|
||||
.foregroundColor(.secondary)
|
||||
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 }) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user