damus

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

RepostedEvent.swift (1458B)


      1 //
      2 //  RepostedEvent.swift
      3 //  damus
      4 //
      5 //  Created by William Casarin on 2023-03-23.
      6 //
      7 
      8 import SwiftUI
      9 
     10 struct RepostedEvent: View {
     11     let damus: DamusState
     12     let event: NostrEvent
     13     let inner_ev: NostrEvent
     14     let options: EventViewOptions
     15     
     16     var body: some View {
     17         VStack(alignment: .leading) {
     18             NavigationLink(value: Route.ProfileByKey(pubkey: event.pubkey)) {
     19                 Reposted(damus: damus, pubkey: event.pubkey)
     20                     .padding(.horizontal)
     21             }
     22            .buttonStyle(PlainButtonStyle())
     23             
     24             //SelectedEventView(damus: damus, event: inner_ev, size: .normal)
     25             EventMutingContainerView(
     26                 damus_state: damus,
     27                 event: inner_ev,
     28                 muteBox: { event_shown, muted_reason in
     29                     AnyView(
     30                         EventMutedBoxView(shown: event_shown, reason: muted_reason)
     31                             .padding(.horizontal, 5)    // Add a bit of horizontal padding to avoid the mute box from touching the edges of the screen
     32                     )
     33                 }) {
     34                 EventView(damus: damus, event: inner_ev, pubkey: inner_ev.pubkey, options: options.union(.wide))
     35             }
     36         }
     37     }
     38 }
     39 
     40 struct RepostedEvent_Previews: PreviewProvider {
     41     static var previews: some View {
     42         RepostedEvent(damus: test_damus_state, event: test_note, inner_ev: test_note, options: [])
     43     }
     44 }