damus

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

commit 69922b1d77f985b68704963ae78620cf516d096d
parent 7343fcd3998cdec59e3d7b5c2ae1fb35f4a887e9
Author: William Casarin <jb55@jb55.com>
Date:   Wed, 12 Jul 2023 08:21:44 -0700

Remove LoadMoreButton

Was an old unused thing

Diffstat:
Mdamus.xcodeproj/project.pbxproj | 4----
Mdamus/Views/Timeline/InnerTimelineView.swift | 1+
Ddamus/Views/Timeline/LoadMoreButton.swift | 50--------------------------------------------------
3 files changed, 1 insertion(+), 54 deletions(-)

diff --git a/damus.xcodeproj/project.pbxproj b/damus.xcodeproj/project.pbxproj @@ -243,7 +243,6 @@ 4CDA128A29E9D10C0006FA5A /* SignalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDA128929E9D10C0006FA5A /* SignalView.swift */; }; 4CDA128C29EB19C40006FA5A /* LocalNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDA128B29EB19C40006FA5A /* LocalNotification.swift */; }; 4CE0E2AF29A2E82100DB4CA2 /* EventHolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE0E2AE29A2E82100DB4CA2 /* EventHolder.swift */; }; - 4CE0E2B229A3DF6900DB4CA2 /* LoadMoreButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE0E2B129A3DF6900DB4CA2 /* LoadMoreButton.swift */; }; 4CE0E2B629A3ED5500DB4CA2 /* InnerTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE0E2B529A3ED5500DB4CA2 /* InnerTimelineView.swift */; }; 4CE1399029F0661A00AC6A0B /* RepostAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE1398F29F0661A00AC6A0B /* RepostAction.swift */; }; 4CE1399229F0666100AC6A0B /* ShareActionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE1399129F0666100AC6A0B /* ShareActionButton.swift */; }; @@ -726,7 +725,6 @@ 4CDA128929E9D10C0006FA5A /* SignalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignalView.swift; sourceTree = "<group>"; }; 4CDA128B29EB19C40006FA5A /* LocalNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotification.swift; sourceTree = "<group>"; }; 4CE0E2AE29A2E82100DB4CA2 /* EventHolder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventHolder.swift; sourceTree = "<group>"; }; - 4CE0E2B129A3DF6900DB4CA2 /* LoadMoreButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadMoreButton.swift; sourceTree = "<group>"; }; 4CE0E2B529A3ED5500DB4CA2 /* InnerTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InnerTimelineView.swift; sourceTree = "<group>"; }; 4CE1398F29F0661A00AC6A0B /* RepostAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepostAction.swift; sourceTree = "<group>"; }; 4CE1399129F0666100AC6A0B /* ShareActionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareActionButton.swift; sourceTree = "<group>"; }; @@ -1393,7 +1391,6 @@ 4CE0E2B029A3DF4700DB4CA2 /* Timeline */ = { isa = PBXGroup; children = ( - 4CE0E2B129A3DF6900DB4CA2 /* LoadMoreButton.swift */, 4CE0E2B529A3ED5500DB4CA2 /* InnerTimelineView.swift */, ); path = Timeline; @@ -1872,7 +1869,6 @@ F7F0BA272978E54D009531F3 /* ParticipantsView.swift in Sources */, 4CF0ABE32981BC7D00D66079 /* UserView.swift in Sources */, 4CE0E2AF29A2E82100DB4CA2 /* EventHolder.swift in Sources */, - 4CE0E2B229A3DF6900DB4CA2 /* LoadMoreButton.swift in Sources */, 4CF0ABF029857E9200D66079 /* Bech32Object.swift in Sources */, 4C3D52B8298DB5C6001C5831 /* TextEvent.swift in Sources */, 4C216F362870A9A700040376 /* InputDismissKeyboard.swift in Sources */, diff --git a/damus/Views/Timeline/InnerTimelineView.swift b/damus/Views/Timeline/InnerTimelineView.swift @@ -71,6 +71,7 @@ struct InnerTimelineView: View { } } +let test_event_holder = EventHolder(events: [], incoming: [test_event]) struct InnerTimelineView_Previews: PreviewProvider { static var previews: some View { diff --git a/damus/Views/Timeline/LoadMoreButton.swift b/damus/Views/Timeline/LoadMoreButton.swift @@ -1,50 +0,0 @@ -// -// LoadMoreButton.swift -// damus -// -// Created by William Casarin on 2023-02-20. -// - -import SwiftUI - -struct LoadMoreButton: View { - @ObservedObject var events: EventHolder - let scroller: ScrollViewProxy? - - func click() { - events.flush() - guard let ev = events.events.first, let scroller else { - return - } - scroll_to_event(scroller: scroller, id: ev.id, delay: 0.1, animate: true) - } - - var body: some View { - Group { - if events.queued > 0 { - Button(action: click) { - Text("Load \(events.queued) more", comment: "Button text for loading more events, where the variable is the number of events.") - } - .font(.system(size: 14, weight: .bold)) - .padding(10) - .frame(height: 30) - .foregroundColor(.white) - .background(LINEAR_GRADIENT) - .clipShape(Capsule()) - } else { - EmptyView() - } - } - } -} - -struct LoadMoreButton_Previews: PreviewProvider { - @StateObject static var events: EventHolder = test_event_holder - - static var previews: some View { - LoadMoreButton(events: events, scroller: nil) - } -} - - -let test_event_holder = EventHolder(events: [], incoming: [test_event])