committed by
William Casarin
parent
0da10eb716
commit
9847f12c95
@@ -27,8 +27,6 @@ struct EventActionBar: View {
|
||||
_bar = ObservedObject(wrappedValue: bar ?? make_actionbar_model(ev: event.id, damus: damus_state))
|
||||
}
|
||||
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
|
||||
var lnurl: String? {
|
||||
damus_state.profiles.lookup(id: event.pubkey)?.lnurl
|
||||
}
|
||||
@@ -172,8 +170,6 @@ func EventActionButton(img: String, col: Color?, action: @escaping () -> ()) ->
|
||||
struct LikeButton: View {
|
||||
let liked: Bool
|
||||
let action: () -> ()
|
||||
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
|
||||
// Following four are Shaka animation properties
|
||||
let timer = Timer.publish(every: 0.10, on: .main, in: .common).autoconnect()
|
||||
@@ -232,7 +228,6 @@ struct EventActionBar_Previews: PreviewProvider {
|
||||
let maxed_bar = ActionBarModel(likes: 999, boosts: 999, zaps: 999, zap_total: 99999999, replies: 999, our_like: test_event, our_boost: test_event, our_zap: nil, our_reply: nil)
|
||||
let extra_max_bar = ActionBarModel(likes: 9999, boosts: 9999, zaps: 9999, zap_total: 99999999, replies: 9999, our_like: test_event, our_boost: test_event, our_zap: nil, our_reply: test_event)
|
||||
let mega_max_bar = ActionBarModel(likes: 9999999, boosts: 99999, zaps: 9999, zap_total: 99999999, replies: 9999999, our_like: test_event, our_boost: test_event, our_zap: test_zap, our_reply: test_event)
|
||||
let zapbar = ActionBarModel(likes: 0, boosts: 0, zaps: 5, zap_total: 10000000, replies: 0, our_like: nil, our_boost: nil, our_zap: nil, our_reply: nil)
|
||||
|
||||
VStack(spacing: 50) {
|
||||
EventActionBar(damus_state: ds, event: ev, bar: bar)
|
||||
|
||||
@@ -14,7 +14,6 @@ struct ShareAction: View {
|
||||
|
||||
@Binding var show_share: Bool
|
||||
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
init(event: NostrEvent, bookmarks: BookmarksManager, show_share: Binding<Bool>) {
|
||||
@@ -44,8 +43,7 @@ struct ShareAction: View {
|
||||
|
||||
let bookmarkImg = isBookmarked ? "bookmark.slash" : "bookmark"
|
||||
let bookmarkTxt = isBookmarked ? NSLocalizedString("Remove Bookmark", comment: "Button text to remove bookmark from a note.") : NSLocalizedString("Add Bookmark", comment: "Button text to add bookmark to a note.")
|
||||
let boomarkCol = isBookmarked ? Color(.red) : nil
|
||||
ShareActionButton(img: bookmarkImg, text: bookmarkTxt, col: boomarkCol) {
|
||||
ShareActionButton(img: bookmarkImg, text: bookmarkTxt) {
|
||||
dismiss()
|
||||
self.bookmarks.updateBookmark(event)
|
||||
isBookmarked = self.bookmarks.isBookmarked(event)
|
||||
|
||||
@@ -10,21 +10,12 @@ import SwiftUI
|
||||
struct ShareActionButton: View {
|
||||
let img: String
|
||||
let text: String
|
||||
let color: Color?
|
||||
let action: () -> ()
|
||||
|
||||
init(img: String, text: String, col: Color?, action: @escaping () -> ()) {
|
||||
self.img = img
|
||||
self.text = text
|
||||
self.color = col
|
||||
self.action = action
|
||||
}
|
||||
|
||||
init(img: String, text: String, action: @escaping () -> ()) {
|
||||
self.img = img
|
||||
self.text = text
|
||||
self.action = action
|
||||
self.color = nil
|
||||
}
|
||||
|
||||
var col: Color {
|
||||
|
||||
Reference in New Issue
Block a user