|
|
|
@ -8,7 +8,6 @@ import SessionMessagingKit
|
|
|
|
|
import SessionUtilitiesKit
|
|
|
|
|
import SignalUtilitiesKit
|
|
|
|
|
import SignalCoreKit
|
|
|
|
|
import SwipeActions
|
|
|
|
|
|
|
|
|
|
enum SearchSection: Int, Differentiable {
|
|
|
|
|
case noResults
|
|
|
|
@ -32,7 +31,6 @@ struct GlobalSearchScreen: View {
|
|
|
|
|
@State private var readConnection: Atomic<Database?> = Atomic(nil)
|
|
|
|
|
@State private var termForCurrentSearchResultSet: String = ""
|
|
|
|
|
@State private var lastSearchText: String?
|
|
|
|
|
@State private var swipeState: SwipeActions.SwipeState = .untouched
|
|
|
|
|
|
|
|
|
|
fileprivate static var defaultSearchResults: [SectionModel] = {
|
|
|
|
|
let result: [SessionThreadViewModel]? = Storage.shared.read { db -> [SessionThreadViewModel]? in
|
|
|
|
@ -189,50 +187,6 @@ struct GlobalSearchScreen: View {
|
|
|
|
|
}()
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
.addSwipeAction(
|
|
|
|
|
edge: .trailing,
|
|
|
|
|
state: $swipeState
|
|
|
|
|
) {
|
|
|
|
|
Button {
|
|
|
|
|
|
|
|
|
|
} label: {
|
|
|
|
|
VStack {
|
|
|
|
|
Image("icon_bin")
|
|
|
|
|
.renderingMode(.template)
|
|
|
|
|
.foregroundColor(themeColor: .textPrimary)
|
|
|
|
|
Text("TXT_DELETE_TITLE".localized())
|
|
|
|
|
.foregroundColor(themeColor: .textPrimary)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.frame(width: 60)
|
|
|
|
|
.frame(maxHeight: .infinity)
|
|
|
|
|
.contentShape(Rectangle())
|
|
|
|
|
.backgroundColor(themeColor: .danger)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Text("Text")
|
|
|
|
|
.addSwipeAction(
|
|
|
|
|
edge: .trailing,
|
|
|
|
|
state: $swipeState
|
|
|
|
|
) {
|
|
|
|
|
Button {
|
|
|
|
|
|
|
|
|
|
} label: {
|
|
|
|
|
VStack {
|
|
|
|
|
Image("icon_bin")
|
|
|
|
|
.renderingMode(.template)
|
|
|
|
|
.foregroundColor(themeColor: .textPrimary)
|
|
|
|
|
Text("TXT_DELETE_TITLE".localized())
|
|
|
|
|
.font(.system(size: Values.mediumFontSize))
|
|
|
|
|
.foregroundColor(themeColor: .textPrimary)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.frame(width: 100)
|
|
|
|
|
.frame(maxHeight: .infinity)
|
|
|
|
|
.contentShape(Rectangle())
|
|
|
|
|
.backgroundColor(themeColor: .danger)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -361,6 +315,9 @@ struct SearchResultCell: View {
|
|
|
|
|
var action: () -> Void
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
Button {
|
|
|
|
|
action()
|
|
|
|
|
} label: {
|
|
|
|
|
HStack(
|
|
|
|
|
alignment: .center,
|
|
|
|
|
spacing: Values.mediumSpacing
|
|
|
|
@ -454,9 +411,6 @@ struct SearchResultCell: View {
|
|
|
|
|
Spacer(minLength: 0)
|
|
|
|
|
}
|
|
|
|
|
.padding(.leading, Values.mediumSpacing)
|
|
|
|
|
.contentShape(Rectangle())
|
|
|
|
|
.onTapGesture {
|
|
|
|
|
action()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|