damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | LICENSE

commit c7e3664831944bf0e85bc38043a9777113b637d2
parent e0059388e8d76147fa192953ff5be7b0aa1d6086
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 11 Apr 2022 14:14:27 -0700

EventView: better spacing

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mdamus/Views/EventView.swift | 29++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/damus/Views/EventView.swift b/damus/Views/EventView.swift @@ -15,18 +15,22 @@ struct EventView: View { var body: some View { HStack { - if let pic = profile?.picture.flatMap { URL(string: $0) } { - CachedAsyncImage(url: pic) { img in - img.resizable() - } placeholder: { + VStack { + if let pic = profile?.picture.flatMap { URL(string: $0) } { + CachedAsyncImage(url: pic) { img in + img.resizable() + } placeholder: { + Color.purple.opacity(0.1) + } + .frame(width: PFP_SIZE, height: PFP_SIZE) + .cornerRadius(CORNER_RADIUS) + } else { Color.purple.opacity(0.1) + .frame(width: PFP_SIZE, height: PFP_SIZE) + .cornerRadius(CORNER_RADIUS) } - .frame(width: PFP_SIZE, height: PFP_SIZE, alignment: .top) - .cornerRadius(CORNER_RADIUS) - } else { - Color.purple.opacity(0.1) - .frame(width: PFP_SIZE, height: PFP_SIZE, alignment: .top) - .cornerRadius(CORNER_RADIUS) + + Spacer() } VStack { @@ -39,10 +43,13 @@ struct EventView: View { Text(event.content) .textSelection(.enabled) .frame(maxWidth: .infinity, alignment: .leading) + + Spacer() + Divider() } - } + .frame(minHeight: PFP_SIZE) } }