Huge refactor to add better structure to the project. Separating features with their associated view and model structure. This should be better organization and will allow us to improve the overall architecture in the future. I forsee many more improvements that can follow this change. e.g. MVVM Arch As well as cleaning up duplicate, unused, functionality. Many files have global functions that can also be moved or be renamed. damus/ ├── Features/ │ ├── <Feature>/ │ │ ├── Views/ │ │ └── Models/ ├── Shared/ │ ├── Components/ │ ├── Media/ │ ├── Buttons/ │ ├── Extensions/ │ ├── Empty Views/ │ ├── ErrorHandling/ │ ├── Modifiers/ │ └── Utilities/ ├── Core/ │ ├── Nostr/ │ ├── NIPs/ │ ├── DIPs/ │ ├── Types/ │ ├── Networking/ │ └── Storage/ Signed-off-by: ericholguin <ericholguin@apache.org>
34 lines
772 B
Swift
34 lines
772 B
Swift
//
|
|
// ReactionView.swift
|
|
// damus
|
|
//
|
|
// Created by William Casarin on 2023-01-11.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ReactionView: View {
|
|
let damus_state: DamusState
|
|
let reaction: NostrEvent
|
|
|
|
var content: String {
|
|
return to_reaction_emoji(ev: reaction) ?? ""
|
|
}
|
|
|
|
var body: some View {
|
|
HStack {
|
|
Text(content)
|
|
.font(Font.headline)
|
|
.frame(width: 50, height: 50)
|
|
|
|
FollowUserView(target: .pubkey(reaction.pubkey), damus_state: damus_state)
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ReactionView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ReactionView(damus_state: test_damus_state, reaction: NostrEvent(content: "🤙🏼", keypair: test_keypair)!)
|
|
}
|
|
}
|