Tweaks to the new profile page
This commit is contained in:
@@ -191,8 +191,6 @@ struct ProfileView: View {
|
|||||||
|
|
||||||
var TopSection: some View {
|
var TopSection: some View {
|
||||||
ZStack(alignment: .top) {
|
ZStack(alignment: .top) {
|
||||||
let data = damus_state.profiles.lookup(id: profile.pubkey)
|
|
||||||
|
|
||||||
GeometryReader { geo in
|
GeometryReader { geo in
|
||||||
Image("profile-banner")
|
Image("profile-banner")
|
||||||
.resizable()
|
.resizable()
|
||||||
@@ -202,13 +200,14 @@ struct ProfileView: View {
|
|||||||
}
|
}
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
let data = damus_state.profiles.lookup(id: profile.pubkey)
|
let data = damus_state.profiles.lookup(id: profile.pubkey)
|
||||||
|
let pfp_size: CGFloat = 90.0
|
||||||
|
|
||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
Circle()
|
Circle()
|
||||||
.frame(width:60, height: 60) // Increase this to see a frame.
|
.frame(width: pfp_size, height: pfp_size) // Increase this to see a frame.
|
||||||
.foregroundColor(imageBorderColor())
|
.foregroundColor(imageBorderColor())
|
||||||
.overlay{
|
.overlay{
|
||||||
ProfilePicView(pubkey: profile.pubkey, size: PFP_SIZE, highlight: .none, profiles: damus_state.profiles)
|
ProfilePicView(pubkey: profile.pubkey, size: pfp_size, highlight: .custom(.black, 4.0), profiles: damus_state.profiles)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
is_zoomed.toggle()
|
is_zoomed.toggle()
|
||||||
}
|
}
|
||||||
@@ -216,7 +215,7 @@ struct ProfileView: View {
|
|||||||
ProfilePicView(pubkey: profile.pubkey, size: zoom_size, highlight: .none, profiles: damus_state.profiles)
|
ProfilePicView(pubkey: profile.pubkey, size: zoom_size, highlight: .none, profiles: damus_state.profiles)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.offset(y: -30) // Increase if set a frame
|
.offset(y: -(pfp_size/2.0)) // Increase if set a frame
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
@@ -244,7 +243,7 @@ struct ProfileView: View {
|
|||||||
|
|
||||||
ProfileNameView(pubkey: profile.pubkey, profile: data, contacts: damus_state.contacts)
|
ProfileNameView(pubkey: profile.pubkey, profile: data, contacts: damus_state.contacts)
|
||||||
//.padding(.bottom)
|
//.padding(.bottom)
|
||||||
.padding(.top,-25)
|
.padding(.top,-(pfp_size/2.0))
|
||||||
|
|
||||||
Text(ProfileView.markdown.process(data?.about ?? ""))
|
Text(ProfileView.markdown.process(data?.about ?? ""))
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
@@ -379,7 +378,6 @@ struct KeyView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
let col = id_to_color(pubkey)
|
|
||||||
let bech32 = bech32_pubkey(pubkey) ?? pubkey
|
let bech32 = bech32_pubkey(pubkey) ?? pubkey
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
@@ -390,6 +388,7 @@ struct KeyView: View {
|
|||||||
HStack {
|
HStack {
|
||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.string = bech32
|
UIPasteboard.general.string = bech32
|
||||||
|
UIImpactFeedbackGenerator(style: .medium).impactOccurred()
|
||||||
isCopied = true
|
isCopied = true
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
||||||
isCopied = false
|
isCopied = false
|
||||||
@@ -406,7 +405,7 @@ struct KeyView: View {
|
|||||||
.symbolRenderingMode(.hierarchical)
|
.symbolRenderingMode(.hierarchical)
|
||||||
}
|
}
|
||||||
.padding(.leading,4)
|
.padding(.leading,4)
|
||||||
Text(bech32)
|
Text(abbrev_pubkey(bech32, amount: 16))
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundColor(keyColor())
|
.foregroundColor(keyColor())
|
||||||
.offset(x:-3) // Not sure why this is needed.
|
.offset(x:-3) // Not sure why this is needed.
|
||||||
@@ -415,6 +414,7 @@ struct KeyView: View {
|
|||||||
if isCopied != true {
|
if isCopied != true {
|
||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.string = bech32
|
UIPasteboard.general.string = bech32
|
||||||
|
UIImpactFeedbackGenerator(style: .medium).impactOccurred()
|
||||||
isCopied = true
|
isCopied = true
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
||||||
isCopied = false
|
isCopied = false
|
||||||
|
|||||||
Reference in New Issue
Block a user