Add QR Code in profiles

Changelog-Added: Add QR Code in profiles
Closes: #918
This commit is contained in:
ericholguin
2023-04-13 20:54:08 -06:00
committed by William Casarin
parent 29ab48287f
commit 5c131e62d7
2 changed files with 19 additions and 4 deletions

View File

@@ -119,6 +119,7 @@ struct ProfileView: View {
@State var showing_select_wallet: Bool = false
@State var is_zoomed: Bool = false
@State var show_share_sheet: Bool = false
@State var show_qr_code: Bool = false
@State var action_sheet_presented: Bool = false
@State var filter_state : FilterState = .posts
@State var yOffset: CGFloat = 0
@@ -213,6 +214,10 @@ struct ProfileView: View {
Button(NSLocalizedString("Share", comment: "Button to share the link to a profile.")) {
show_share_sheet = true
}
Button(NSLocalizedString("QR Code", comment: "Button to view profile's qr code.")) {
show_qr_code = true
}
// Only allow reporting if logged in with private key and the currently viewed profile is not the logged in profile.
if profile.pubkey != damus_state.pubkey && damus_state.is_privkey_user {
@@ -465,6 +470,9 @@ struct ProfileView: View {
}
}
}
.fullScreenCover(isPresented: $show_qr_code) {
QRCodeView(damus_state: damus_state, pubkey: profile.pubkey)
}
}
}