diff --git a/apps/ios/Shared/Views/NewChat/AddContactView.swift b/apps/ios/Shared/Views/NewChat/AddContactView.swift index 99f62e65c8..a965d72dbb 100644 --- a/apps/ios/Shared/Views/NewChat/AddContactView.swift +++ b/apps/ios/Shared/Views/NewChat/AddContactView.swift @@ -12,25 +12,27 @@ import CoreImage.CIFilterBuiltins struct AddContactView: View { var connReqInvitation: String var body: some View { - VStack(alignment: .leading) { - Text("One-time invitation link") - .font(.title) - .padding(.vertical) - Text("Your contact can scan it from the app") - .padding(.bottom) - QRCode(uri: connReqInvitation) - .padding(.bottom) - Text("If you can't meet in person, **show QR code in the video call**, or share the link.") - .padding(.bottom) - Button { - showShareSheet(items: [connReqInvitation]) - } label: { - Label("Share invitation link", systemImage: "square.and.arrow.up") + ScrollView { + VStack(alignment: .leading) { + Text("One-time invitation link") + .font(.title) + .padding(.vertical) + Text("Your contact can scan it from the app") + .padding(.bottom) + QRCode(uri: connReqInvitation) + .padding(.bottom) + Text("If you can't meet in person, **show QR code in the video call**, or share the link.") + .padding(.bottom) + Button { + showShareSheet(items: [connReqInvitation]) + } label: { + Label("Share invitation link", systemImage: "square.and.arrow.up") + } + .frame(maxWidth: .infinity, alignment: .center) } - .frame(maxWidth: .infinity, alignment: .center) + .padding() + .frame(maxHeight: .infinity, alignment: .top) } - .padding() - .frame(maxHeight: .infinity, alignment: .top) } } diff --git a/apps/ios/Shared/Views/UserSettings/UserAddress.swift b/apps/ios/Shared/Views/UserSettings/UserAddress.swift index c1ff708233..16e4994d33 100644 --- a/apps/ios/Shared/Views/UserSettings/UserAddress.swift +++ b/apps/ios/Shared/Views/UserSettings/UserAddress.swift @@ -13,61 +13,63 @@ struct UserAddress: View { @State private var deleteAddressAlert = false var body: some View { - VStack (alignment: .leading) { - Text("You can share your address as a link or as a QR code - anybody will be able to connect to you. You won't lose your contacts if you later delete it.") - .padding(.bottom) - if let userAdress = chatModel.userAddress { - QRCode(uri: userAdress) - HStack { - Button { - showShareSheet(items: [userAdress]) - } label: { - Label("Share link", systemImage: "square.and.arrow.up") - } - .padding() + ScrollView { + VStack (alignment: .leading) { + Text("You can share your address as a link or as a QR code - anybody will be able to connect to you. You won't lose your contacts if you later delete it.") + .padding(.bottom) + if let userAdress = chatModel.userAddress { + QRCode(uri: userAdress) + HStack { + Button { + showShareSheet(items: [userAdress]) + } label: { + Label("Share link", systemImage: "square.and.arrow.up") + } + .padding() - Button(role: .destructive) { deleteAddressAlert = true } label: { - Label("Delete address", systemImage: "trash") - } - .padding() - .alert(isPresented: $deleteAddressAlert) { - Alert( - title: Text("Delete address?"), - message: Text("All your contacts will remain connected"), - primaryButton: .destructive(Text("Delete")) { - Task { - do { - try await apiDeleteUserAddress() - DispatchQueue.main.async { - chatModel.userAddress = nil + Button(role: .destructive) { deleteAddressAlert = true } label: { + Label("Delete address", systemImage: "trash") + } + .padding() + .alert(isPresented: $deleteAddressAlert) { + Alert( + title: Text("Delete address?"), + message: Text("All your contacts will remain connected"), + primaryButton: .destructive(Text("Delete")) { + Task { + do { + try await apiDeleteUserAddress() + DispatchQueue.main.async { + chatModel.userAddress = nil + } + } catch let error { + logger.error("UserAddress apiDeleteUserAddress: \(error.localizedDescription)") } - } catch let error { - logger.error("UserAddress apiDeleteUserAddress: \(error.localizedDescription)") } - } - }, secondaryButton: .cancel() - ) - } - } - .frame(maxWidth: .infinity) - } else { - Button { - Task { - do { - let userAddress = try await apiCreateUserAddress() - DispatchQueue.main.async { - chatModel.userAddress = userAddress - } - } catch let error { - logger.error("UserAddress apiCreateUserAddress: \(error.localizedDescription)") + }, secondaryButton: .cancel() + ) } } - } label: { Label("Create address", systemImage: "qrcode") } - .frame(maxWidth: .infinity) + .frame(maxWidth: .infinity) + } else { + Button { + Task { + do { + let userAddress = try await apiCreateUserAddress() + DispatchQueue.main.async { + chatModel.userAddress = userAddress + } + } catch let error { + logger.error("UserAddress apiCreateUserAddress: \(error.localizedDescription)") + } + } + } label: { Label("Create address", systemImage: "qrcode") } + .frame(maxWidth: .infinity) + } } + .padding() + .frame(maxHeight: .infinity, alignment: .top) } - .padding() - .frame(maxHeight: .infinity, alignment: .top) } }