Skip to content

Commit

Permalink
Replace SearchField with searchable modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
lunij committed Sep 22, 2024
1 parent 733ee5f commit 2b983c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 45 deletions.
41 changes: 0 additions & 41 deletions Sources/Netbob/Core/UI/SearchField.swift

This file was deleted.

5 changes: 2 additions & 3 deletions Sources/Netbob/Modules/List/ListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ struct ListView: View {
@StateObject var state: ListViewStateAbstract

var body: some View {
SearchField(text: $state.searchText)
.padding(.horizontal)

List {
ForEach(state.connections) { viewData in
NavigationLink(destination: DetailView(state: .init(connection: viewData.connection))) {
Expand All @@ -20,6 +17,8 @@ struct ListView: View {
}
.navigationBarItems(trailing: navigationBarButtons)
.activitySheet(state: $state.activitySheetState)
.searchable(text: $state.searchText, prompt: "Search ...")
.textInputAutocapitalization(.never)
.onAppear {
state.onAppear()
}
Expand Down
5 changes: 4 additions & 1 deletion Tests/NetbobTests/Modules/List/ListViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import SnapshotTesting
import SwiftUI
import XCTest
@testable import Netbob

Expand All @@ -14,7 +15,9 @@ class ListViewTests: XCTestCase {
}
TimeZoneProvider.shared.current = gmt

let view = ListView(state: ListViewStateMock())
let view = NavigationView {
ListView(state: ListViewStateMock())
}

assertSnapshot(of: view)
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b983c4

Please sign in to comment.