Browse Source

Some layout changes to the profile view

profile-edit
Sam DuBois 2 years ago
parent
commit
9ca68efb32
  1. 4
      damus/Views/EventView.swift
  2. 9
      damus/Views/ProfileView.swift

4
damus/Views/EventView.swift

@ -93,9 +93,11 @@ struct EventView: View {
} }
.buttonStyle(PlainButtonStyle()) .buttonStyle(PlainButtonStyle())
TextEvent(inner_ev, pubkey: inner_ev.pubkey) TextEvent(inner_ev, pubkey: inner_ev.pubkey)
.padding([.top], 2)
} }
} else { } else {
TextEvent(event, pubkey: pubkey) TextEvent(event, pubkey: pubkey)
.padding([.top], 6)
} }
} }
} }
@ -146,7 +148,7 @@ struct EventView: View {
.background(event_validity_color(event.validity)) .background(event_validity_color(event.validity))
.id(event.id) .id(event.id)
.frame(maxWidth: .infinity, minHeight: PFP_SIZE) .frame(maxWidth: .infinity, minHeight: PFP_SIZE)
.padding([.bottom], 4) .padding([.bottom], 2)
.event_context_menu(event, privkey: damus.keypair.privkey) .event_context_menu(event, privkey: damus.keypair.privkey)
} }
} }

9
damus/Views/ProfileView.swift

@ -55,7 +55,7 @@ struct ProfileNameView: View {
if let real_name = profile?.display_name { if let real_name = profile?.display_name {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Text(real_name) Text(real_name)
.font(.title) .font(.title3.weight(.bold))
ProfileName(pubkey: pubkey, profile: profile, prefix: "@", contacts: contacts, show_friend_confirmed: true) ProfileName(pubkey: pubkey, profile: profile, prefix: "@", contacts: contacts, show_friend_confirmed: true)
.font(.callout) .font(.callout)
.foregroundColor(.gray) .foregroundColor(.gray)
@ -103,8 +103,6 @@ struct ProfileView: View {
HStack(alignment: .center) { HStack(alignment: .center) {
ProfilePicView(pubkey: profile.pubkey, size: PFP_SIZE, highlight: .custom(Color.black, 2), profiles: damus_state.profiles) ProfilePicView(pubkey: profile.pubkey, size: PFP_SIZE, highlight: .custom(Color.black, 2), profiles: damus_state.profiles)
ProfileNameView(pubkey: profile.pubkey, profile: data, contacts: damus_state.contacts)
Spacer() Spacer()
@ -119,6 +117,9 @@ struct ProfileView: View {
FollowButtonView(target: profile.get_follow_target(), follow_state: damus_state.contacts.follow_state(profile.pubkey)) FollowButtonView(target: profile.get_follow_target(), follow_state: damus_state.contacts.follow_state(profile.pubkey))
} }
ProfileNameView(pubkey: profile.pubkey, profile: data, contacts: damus_state.contacts)
.padding(.bottom)
KeyView(pubkey: profile.pubkey) KeyView(pubkey: profile.pubkey)
.padding(.bottom, 10) .padding(.bottom, 10)
.pubkey_context_menu(bech32_pubkey: bech32_pubkey(profile.pubkey) ?? profile.pubkey) .pubkey_context_menu(bech32_pubkey: bech32_pubkey(profile.pubkey) ?? profile.pubkey)
@ -158,6 +159,7 @@ struct ProfileView: View {
VStack(alignment: .leading) { VStack(alignment: .leading) {
ScrollView { ScrollView {
TopSection TopSection
.padding(.horizontal)
Divider() Divider()
@ -165,7 +167,6 @@ struct ProfileView: View {
} }
.frame(maxHeight: .infinity, alignment: .topLeading) .frame(maxHeight: .infinity, alignment: .topLeading)
} }
.padding([.leading, .trailing], 6)
.frame(maxWidth: .infinity, alignment: .topLeading) .frame(maxWidth: .infinity, alignment: .topLeading)
.navigationBarTitle("Profile") .navigationBarTitle("Profile")
.onReceive(handle_notify(.switched_timeline)) { _ in .onReceive(handle_notify(.switched_timeline)) { _ in

Loading…
Cancel
Save