mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Hide the search mode picker until there's a query
The chats/messages picker has nothing to switch between before a query is entered, so it only shows once the user starts searching.
This commit is contained in:
@@ -40,14 +40,17 @@ struct SearchScreen: View {
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.vertical, 8)
|
||||
|
||||
Picker(L10n.actionSearch, selection: $context.searchMode) {
|
||||
ForEach(SearchScreenMode.allCases) { mode in
|
||||
Text(mode.title).tag(mode)
|
||||
// There's nothing to switch between until the user searches for something.
|
||||
if context.viewState.isSearching {
|
||||
Picker(L10n.actionSearch, selection: $context.searchMode) {
|
||||
ForEach(SearchScreenMode.allCases) { mode in
|
||||
Text(mode.title).tag(mode)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.bottom, 8)
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.bottom, 8)
|
||||
|
||||
switch context.viewState.bindings.searchMode {
|
||||
case .rooms:
|
||||
|
||||
Reference in New Issue
Block a user