mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-31 09:46:03 +00:00
* ios: incognito types * wip * wip * wip * wip * wip * cleaner interface * CIGroupInvitationView logic * masks not filled * ui improvements * wip * wip * incognito may be compromised alerts * help * remove modifier * Update apps/ios/Shared/Views/Chat/ChatItem/CIGroupInvitationView.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * Update apps/ios/Shared/Views/Chat/Group/AddGroupMembersView.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * Update apps/ios/Shared/Views/UserSettings/IncognitoHelp.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * Update apps/ios/Shared/Views/UserSettings/IncognitoHelp.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * Update apps/ios/Shared/Views/UserSettings/IncognitoHelp.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * Update apps/ios/Shared/Views/UserSettings/IncognitoHelp.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * Update apps/ios/Shared/Views/UserSettings/IncognitoHelp.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * Update apps/ios/Shared/Views/UserSettings/IncognitoHelp.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * contact request * texts * ; * prepare for merge * restore help * wip * update help * wip * update incognito help * the * Update apps/ios/Shared/Views/UserSettings/IncognitoHelp.swift Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * wording * translations * secondary color * translations * translations * fix Your Chats title Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
65 lines
2.1 KiB
Swift
65 lines
2.1 KiB
Swift
//
|
|
// ConnectContactView.swift
|
|
// SimpleX
|
|
//
|
|
// Created by Evgeny Poberezkin on 29/01/2022.
|
|
// Copyright © 2022 SimpleX Chat. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
import CodeScanner
|
|
|
|
struct ScanToConnectView: View {
|
|
@EnvironmentObject var chatModel: ChatModel
|
|
@Environment(\.dismiss) var dismiss: DismissAction
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading) {
|
|
Text("Scan QR code")
|
|
.font(.title)
|
|
.padding(.vertical)
|
|
if (chatModel.incognito) {
|
|
HStack {
|
|
Image(systemName: "theatermasks").foregroundColor(.indigo).font(.footnote)
|
|
Spacer().frame(width: 8)
|
|
Text("A random profile will be sent to your contact").font(.footnote)
|
|
}
|
|
.padding(.bottom)
|
|
} else {
|
|
HStack {
|
|
Image(systemName: "info.circle").foregroundColor(.secondary).font(.footnote)
|
|
Spacer().frame(width: 8)
|
|
Text("Your chat profile will be sent to your contact").font(.footnote)
|
|
}
|
|
.padding(.bottom)
|
|
}
|
|
ZStack {
|
|
CodeScannerView(codeTypes: [.qr], completion: processQRCode)
|
|
.aspectRatio(1, contentMode: .fit)
|
|
.border(.gray)
|
|
}
|
|
.padding(.bottom)
|
|
Text("If you cannot meet in person, you can **scan QR code in the video call**, or your contact can share an invitation link.")
|
|
.padding(.bottom)
|
|
}
|
|
.padding()
|
|
.frame(maxHeight: .infinity, alignment: .top)
|
|
}
|
|
|
|
func processQRCode(_ resp: Result<ScanResult, ScanError>) {
|
|
switch resp {
|
|
case let .success(r):
|
|
Task { connectViaLink(r.string, dismiss) }
|
|
case let .failure(e):
|
|
logger.error("ConnectContactView.processQRCode QR code error: \(e.localizedDescription)")
|
|
dismiss()
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ConnectContactView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ScanToConnectView()
|
|
}
|
|
}
|