Browse Source

EventView: better spacing

Signed-off-by: William Casarin <jb55@jb55.com>
profiles-everywhere
William Casarin 3 years ago
parent
commit
c7e3664831
  1. 13
      damus/Views/EventView.swift

13
damus/Views/EventView.swift

@ -15,20 +15,24 @@ struct EventView: View {
var body: some View { var body: some View {
HStack { HStack {
VStack {
if let pic = profile?.picture.flatMap { URL(string: $0) } { if let pic = profile?.picture.flatMap { URL(string: $0) } {
CachedAsyncImage(url: pic) { img in CachedAsyncImage(url: pic) { img in
img.resizable() img.resizable()
} placeholder: { } placeholder: {
Color.purple.opacity(0.1) Color.purple.opacity(0.1)
} }
.frame(width: PFP_SIZE, height: PFP_SIZE, alignment: .top) .frame(width: PFP_SIZE, height: PFP_SIZE)
.cornerRadius(CORNER_RADIUS) .cornerRadius(CORNER_RADIUS)
} else { } else {
Color.purple.opacity(0.1) Color.purple.opacity(0.1)
.frame(width: PFP_SIZE, height: PFP_SIZE, alignment: .top) .frame(width: PFP_SIZE, height: PFP_SIZE)
.cornerRadius(CORNER_RADIUS) .cornerRadius(CORNER_RADIUS)
} }
Spacer()
}
VStack { VStack {
Text(String(profile?.name ?? String(event.pubkey.prefix(16)))) Text(String(profile?.name ?? String(event.pubkey.prefix(16))))
.bold() .bold()
@ -39,10 +43,13 @@ struct EventView: View {
Text(event.content) Text(event.content)
.textSelection(.enabled) .textSelection(.enabled)
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
Spacer()
Divider() Divider()
} }
} }
.frame(minHeight: PFP_SIZE)
} }
} }

Loading…
Cancel
Save