damus

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

ReactionView.swift (772B)


      1 //
      2 //  ReactionView.swift
      3 //  damus
      4 //
      5 //  Created by William Casarin on 2023-01-11.
      6 //
      7 
      8 import SwiftUI
      9 
     10 struct ReactionView: View {
     11     let damus_state: DamusState
     12     let reaction: NostrEvent
     13     
     14     var content: String {
     15         return to_reaction_emoji(ev: reaction) ?? ""
     16     }
     17     
     18     var body: some View {
     19         HStack {
     20             Text(content)
     21                 .font(Font.headline)
     22                 .frame(width: 50, height: 50)
     23             
     24             FollowUserView(target: .pubkey(reaction.pubkey), damus_state: damus_state)
     25         }
     26     }
     27 }
     28 
     29 struct ReactionView_Previews: PreviewProvider {
     30     static var previews: some View {
     31         ReactionView(damus_state: test_damus_state, reaction: NostrEvent(content: "🤙🏼", keypair: test_keypair)!)
     32     }
     33 }