diff --git a/ElementX/Sources/Screens/SearchScreen/View/SearchScreen.swift b/ElementX/Sources/Screens/SearchScreen/View/SearchScreen.swift index 23be1c4ff..e5f8b55da 100644 --- a/ElementX/Sources/Screens/SearchScreen/View/SearchScreen.swift +++ b/ElementX/Sources/Screens/SearchScreen/View/SearchScreen.swift @@ -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: diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPad-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPad-en-GB.png index 66c39872b..859e3478f 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPad-en-GB.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPad-en-GB.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7bfea050d80105ee2383b4c53466ca42f2a17bebad5d8211882292f75803a3e2 -size 93453 +oid sha256:99f93030951c29a907a1097916bb5a783211e6f6fed89b9d7bda87a35a0f024c +size 86970 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPad-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPad-pseudo.png index b5a78f2c3..5c9f05c8a 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPad-pseudo.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPad-pseudo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e40f5ec001e372489b4ae212080364b779caaeb80e5cea0fbc42b0626d57e2a1 -size 100371 +oid sha256:bee04cd0aec01b6559ad6e76f6be1809950ee62fde425880d4efd5d7bbfebb6b +size 92348 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPhone-en-GB.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPhone-en-GB.png index dc2c38e80..9428cded1 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPhone-en-GB.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPhone-en-GB.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ad035e3a8905a8c16aa69cb6f7a640b022454812fd808eec45649995d85a4aa -size 49390 +oid sha256:9d7e618d79d4a0c0fd7b931880f87ee000f57f75d52b51e50fd421bbc3a0a478 +size 44012 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPhone-pseudo.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPhone-pseudo.png index 41d122bd3..7b893246d 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPhone-pseudo.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/searchScreen.Empty-iPhone-pseudo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37a6276be4d882858a34511cbc743154c84630e080835980d3744b5d5f6cf080 -size 60230 +oid sha256:a446fa6595aa3199c60a97ee3d4df423fcc2e07a2726343c3c0d1c12678d997f +size 53981