Use search field style from Compound. (#839)

This commit is contained in:
Doug
2023-04-28 11:59:40 +01:00
committed by GitHub
parent c96ccd0f26
commit 18766d5852
10 changed files with 16 additions and 114 deletions
@@ -14,6 +14,7 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct EmojiPickerScreen: View {
@@ -45,7 +46,7 @@ struct EmojiPickerScreen: View {
.navigationBarTitleDisplayMode(.inline)
.toolbar { toolbar }
.searchable(text: $searchString)
.searchableStyle(.list)
.compoundSearchField()
.onChange(of: searchString) { _ in
context.send(viewAction: .search(searchString: searchString))
}
@@ -14,6 +14,7 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct HomeScreen: View {
@@ -63,7 +64,7 @@ struct HomeScreen: View {
}
}
.searchable(text: $context.searchQuery)
.searchableStyle(.list)
.compoundSearchField()
.disableAutocorrection(true)
}
}
@@ -14,6 +14,7 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct InviteUsersScreen: View {
@@ -36,6 +37,7 @@ struct InviteUsersScreen: View {
}
}
.searchable(text: $context.searchQuery, placement: .navigationBarDrawer(displayMode: .always), prompt: L10n.commonSearchForSomeone)
.compoundSearchField()
.alert(item: $context.alertInfo) { $0.alert }
}
@@ -14,6 +14,7 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct RoomMembersListScreen: View {
@@ -39,7 +40,7 @@ struct RoomMembersListScreen: View {
}
}
.searchable(text: $context.searchQuery, placement: .navigationBarDrawer(displayMode: .always))
.searchableStyle(.list)
.compoundSearchField()
.background(Color.element.background.ignoresSafeArea())
.navigationTitle(L10n.commonPeople)
.alert(item: $context.alertInfo) { $0.alert }
@@ -14,6 +14,7 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct StartChatScreen: View {
@@ -37,6 +38,7 @@ struct StartChatScreen: View {
}
}
.searchable(text: $context.searchQuery, placement: .navigationBarDrawer(displayMode: .always), prompt: L10n.commonSearchForSomeone)
.compoundSearchField()
.alert(item: $context.alertInfo) { $0.alert }
}