Profile Banner Images

Changelog-Added: Profile banner images
Closes: #302
This commit is contained in:
Jason Jōb
2023-01-10 15:12:34 -08:00
committed by William Casarin
parent 33383265c8
commit 9d44ed0bfe
8 changed files with 151 additions and 15 deletions

View File

@@ -194,15 +194,14 @@ struct ProfileView: View {
var TopSection: some View {
ZStack(alignment: .top) {
GeometryReader { geo in
Image("profile-banner")
.resizable()
BannerImageView(pubkey: damus_state.pubkey, profiles: damus_state.profiles)
.aspectRatio(contentMode: .fill)
.frame(width: geo.size.width, height: 150)
.frame(width: geo.size.width, height: BANNER_HEIGHT)
.clipped()
ShareButton
.offset(x: geo.size.width - 80.0, y: 50.0 )
}
}.frame(height: BANNER_HEIGHT)
VStack(alignment: .leading) {
let data = damus_state.profiles.lookup(id: profile.pubkey)
let pfp_size: CGFloat = 90.0
@@ -358,7 +357,7 @@ func test_damus_state() -> DamusState {
let pubkey = "3efdaebb1d8923ebd99c9e7ace3b4194ab45512e2be79c1b7d68d9243e0d2681"
let damus = DamusState(pool: RelayPool(), keypair: Keypair(pubkey: pubkey, privkey: "privkey"), likes: EventCounter(our_pubkey: pubkey), boosts: EventCounter(our_pubkey: pubkey), contacts: Contacts(our_pubkey: pubkey), tips: TipCounter(our_pubkey: pubkey), profiles: Profiles(), dms: DirectMessagesModel(), previews: PreviewCache())
let prof = Profile(name: "damus", display_name: "damus", about: "iOS app!", picture: "https://damus.io/img/logo.png", website: "https://damus.io", lud06: nil, lud16: "jb55@sendsats.lol", nip05: "damus.io")
let prof = Profile(name: "damus", display_name: "damus", about: "iOS app!", picture: "https://damus.io/img/logo.png", banner: "", website: "https://damus.io", lud06: nil, lud16: "jb55@sendsats.lol", nip05: "damus.io")
let tsprof = TimestampedProfile(profile: prof, timestamp: 0)
damus.profiles.add(id: pubkey, profile: tsprof)
return damus