mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-12 19:35:00 +00:00
33 lines
864 B
Swift
33 lines
864 B
Swift
//
|
|
// NewChatScanButton.swift
|
|
// SimpleX (iOS)
|
|
//
|
|
// Created by spaced4ndy on 30.11.2023.
|
|
// Copyright © 2023 SimpleX Chat. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct NewChatScanButton: View {
|
|
@State private var showNewChatSheet = false
|
|
|
|
var body: some View {
|
|
Button {
|
|
showNewChatSheet = true
|
|
} label: {
|
|
Image(systemName: "qrcode")
|
|
.resizable()
|
|
.scaledToFit()
|
|
.frame(width: 20, height: 20)
|
|
}
|
|
.sheet(isPresented: $showNewChatSheet) {
|
|
NewChatView(selection: .connect, showQRCodeScanner: true)
|
|
.environment(\EnvironmentValues.refresh as! WritableKeyPath<EnvironmentValues, RefreshAction?>, nil) // fixes .refreshable in ChatListView affecting nested view
|
|
}
|
|
}
|
|
}
|
|
|
|
//#Preview {
|
|
// NewChatScanButton()
|
|
//}
|