Updated QR Code view, include profile image, name, and remove pubkey text
Closes: #443 Changelog-Changed: Updated QR code view, include profile image, etc
This commit is contained in:
committed by
William Casarin
parent
d5ee9e4780
commit
99b619e011
@@ -23,19 +23,44 @@ struct QRCodeView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack(alignment: .topLeading) {
|
ZStack(alignment: .center) {
|
||||||
DamusGradient()
|
|
||||||
Button {
|
ZStack(alignment: .topLeading) {
|
||||||
presentationMode.wrappedValue.dismiss()
|
DamusGradient()
|
||||||
} label: {
|
Button {
|
||||||
Image(systemName: "xmark")
|
presentationMode.wrappedValue.dismiss()
|
||||||
.foregroundColor(.white)
|
} label: {
|
||||||
.font(.subheadline)
|
Image(systemName: "xmark")
|
||||||
.padding(.leading, 20)
|
.foregroundColor(.white)
|
||||||
|
.font(.subheadline)
|
||||||
|
.padding(.leading, 20)
|
||||||
|
}
|
||||||
|
.zIndex(1)
|
||||||
}
|
}
|
||||||
.zIndex(1)
|
|
||||||
|
|
||||||
VStack(alignment: .center) {
|
VStack(alignment: .center) {
|
||||||
|
let profile = damus_state.profiles.lookup(id: damus_state.pubkey)
|
||||||
|
|
||||||
|
if (damus_state.profiles.lookup(id: damus_state.pubkey)?.picture) != nil {
|
||||||
|
ProfilePicView(pubkey: damus_state.pubkey, size: 90.0, highlight: .custom(Color("DamusWhite"), 4.0), profiles: damus_state.profiles)
|
||||||
|
.padding(.top, 50)
|
||||||
|
} else {
|
||||||
|
Image(systemName: "person.fill")
|
||||||
|
.font(.system(size: 60))
|
||||||
|
.foregroundColor(Color("DamusWhite"))
|
||||||
|
.padding(.top, 50)
|
||||||
|
}
|
||||||
|
|
||||||
|
if let display_name = profile?.display_name {
|
||||||
|
Text(display_name)
|
||||||
|
.foregroundColor(Color("DamusWhite"))
|
||||||
|
.font(.system(size: 24, weight: .heavy))
|
||||||
|
}
|
||||||
|
if let name = profile?.name {
|
||||||
|
Text("@" + name)
|
||||||
|
.foregroundColor(Color("DamusWhite"))
|
||||||
|
.font(.body)
|
||||||
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
@@ -46,15 +71,24 @@ struct QRCodeView: View {
|
|||||||
.scaledToFit()
|
.scaledToFit()
|
||||||
.frame(width: 200, height: 200)
|
.frame(width: 200, height: 200)
|
||||||
.padding()
|
.padding()
|
||||||
|
.cornerRadius(10)
|
||||||
Text(key)
|
.overlay(RoundedRectangle(cornerRadius: 10)
|
||||||
.font(.headline)
|
.stroke(Color("DamusWhite"), lineWidth: 1))
|
||||||
.foregroundColor(Color(.white))
|
.shadow(radius: 10)
|
||||||
.padding()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
|
Text("Follow me on nostr")
|
||||||
|
.foregroundColor(Color("DamusWhite"))
|
||||||
|
.font(.system(size: 24, weight: .heavy))
|
||||||
|
.padding(.top)
|
||||||
|
|
||||||
|
Text("Scan the code")
|
||||||
|
.foregroundColor(Color("DamusWhite"))
|
||||||
|
.font(.system(size: 18, weight: .ultraLight))
|
||||||
|
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user