* ios: connection UI (wip) * custom search * rework invite * connect paste link ui * scan rework, process errors, other fixes * scan layout * clear link on cancel * improved search * further improve search * animation * connect on paste in search * layout * layout * layout * layout, add conn * delete unused invitation, create used invitation chat * remove old views * regular paste button * new chat menu * previews * increase spacing * animation, fix alerts * swipe * change text * less sensitive gesture * layout * search cancel button transition * slow down chat list animation (uses deprecated modifiers) * icons * update code scanner, layout * manage camera permissions * ask to delete unused invitation * comment * remove onDismiss * don't filter chats on link in search, allow to paste text with link * cleanup link after connection * filter chat by link * revert change * show link descr * disabled search * underline * filter own group * simplify * no animation * add delay, move createInvitation * update library * possible fix for ios 15 * add explicit frame to qr code * update library * Revert "add explicit frame to qr code" This reverts commit95c7d31e47. * remove comment * fix pasteboardHasURLs, disable paste button based on it * align help texts with changed button names Co-authored-by: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> * update library * Revert "fix pasteboardHasURLs, disable paste button based on it" This reverts commit46f63572e9. * remove unused var * restore disabled * export localizations --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Co-authored-by: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com>
53 lines
1.2 KiB
Swift
53 lines
1.2 KiB
Swift
//
|
|
// NewChatMenuButton.swift
|
|
// SimpleX (iOS)
|
|
//
|
|
// Created by spaced4ndy on 28.11.2023.
|
|
// Copyright © 2023 SimpleX Chat. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
enum NewChatMenuOption: Identifiable {
|
|
case newContact
|
|
case newGroup
|
|
|
|
var id: Self { self }
|
|
}
|
|
|
|
struct NewChatMenuButton: View {
|
|
@Binding var newChatMenuOption: NewChatMenuOption?
|
|
|
|
var body: some View {
|
|
Menu {
|
|
Button {
|
|
newChatMenuOption = .newContact
|
|
} label: {
|
|
Text("Add contact")
|
|
}
|
|
Button {
|
|
newChatMenuOption = .newGroup
|
|
} label: {
|
|
Text("Create group")
|
|
}
|
|
} label: {
|
|
Image(systemName: "square.and.pencil")
|
|
.resizable()
|
|
.scaledToFit()
|
|
.frame(width: 24, height: 24)
|
|
}
|
|
.sheet(item: $newChatMenuOption) { opt in
|
|
switch opt {
|
|
case .newContact: NewChatView(selection: .invite)
|
|
case .newGroup: AddGroupView()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
NewChatMenuButton(
|
|
newChatMenuOption: Binding.constant(nil)
|
|
)
|
|
}
|