updated ui for macos and ios
iOS CI / Build and Test SwiftUI App (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (push) Canceled after 0s

This commit is contained in:
wt committed 2026-08-31 19:11:38 +07:00
1 parent df7ab24677
commit e3fcee3351
10 files changed
+619 -576

No files matched your search

+44 -15
View File
@@ -8,21 +8,10 @@ struct NewChatView: View {
@State private var addToRoster = true
var body: some View {
#if os(iOS)
NavigationStack {
Form {
Section("Контакт") {
TextField("user@example.org", text: $jid)
.disableAutocorrection(true)
#if os(iOS)
.keyboardType(.emailAddress)
#endif
TextField("Имя (необязательно)", text: $name)
}
Section {
Toggle("Добавить в roster", isOn: $addToRoster)
} footer: {
Text("Начать чат можно с любым полным JID. Для шифрования у контакта должно быть опубликовано хотя бы одно OMEMO-устройство.")
}
formcontent()
}
.navigationTitle("Новый чат")
.toolbar {
@@ -43,8 +32,48 @@ struct NewChatView: View {
}
}
}
#if os(macOS)
.frame(minWidth: 380, minHeight: 300)
#else
List {
formcontent()
HStack {
Button("Отмена") { dismiss() }
.buttonStyle(.glass)
.controlSize(.large)
.tint(.secondary)
Spacer()
Button("Начать") {
model.openConversation(
jid: jid,
name: name.isEmpty ? nil : name,
addToRoster: addToRoster
)
if model.errorMessage == nil { dismiss() }
}
.fontWeight(.semibold)
.disabled(jid.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
.buttonStyle(.glassProminent)
.controlSize(.large)
}
}
.navigationTitle("Новый чат")
.frame(minWidth: 380, minHeight: 220)
#endif
}
@ViewBuilder
private func formcontent() -> some View {
Section("Контакт") {
TextField("user@example.org", text: $jid)
.disableAutocorrection(true)
#if os(iOS)
.keyboardType(.emailAddress)
#endif
TextField("Имя (необязательно)", text: $name)
}
Section {
Toggle("Добавить в roster", isOn: $addToRoster)
.toggleStyle(.switch)
} footer: {
Text("Начать чат можно с любым полным JID. Для шифрования у контакта должно быть опубликовано хотя бы одно OMEMO-устройство.")
}
}
}