Skip to content

Commit b057ad7

Browse files
committed
Update the view to show redacted and shimmer effects when required
1 parent 6a1fd90 commit b057ad7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/FilterListSelector.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import SwiftUI
2+
import Shimmer
23

34
protocol FilterListSelectorViewModelable: ObservableObject {
45

@@ -19,6 +20,10 @@ protocol FilterListSelectorViewModelable: ObservableObject {
1920
/// Placeholder for the filter text field
2021
///
2122
var filterPlaceholder: String { get }
23+
24+
/// Value to indicate if the views should be redacted
25+
///
26+
var showPlaceholders: Bool { get }
2227
}
2328

2429
/// Filterable List Selector View
@@ -37,6 +42,8 @@ struct FilterListSelector<ViewModel: FilterListSelectorViewModelable>: View {
3742
ListSelector(command: viewModel.command, tableStyle: .plain)
3843
}
3944
.navigationTitle(viewModel.navigationTitle)
45+
.redacted(reason: viewModel.showPlaceholders ? .placeholder : [])
46+
.shimmering(active: viewModel.showPlaceholders)
4047
}
4148
}
4249

WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/StateSelectorViewModel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ final class StateSelectorViewModel: FilterListSelectorViewModelable, ObservableO
2525
/// Filter text field placeholder
2626
///
2727
let filterPlaceholder = Localization.placeholder
28+
29+
/// States do not require data loading
30+
///
31+
let showPlaceholders = false
2832
}
2933

3034
// MARK: Constants

0 commit comments

Comments
 (0)