@@ -7,7 +7,7 @@ import SwiftUI
77// MARK: - SearchableItemListView
88
99/// A view that displays the items in a single vault group.
10- private struct SearchableItemListView : View { // swiftlint:disable:this type_body_length
10+ private struct SearchableItemListView : View {
1111 // MARK: Properties
1212
1313 /// A flag indicating if the search bar is focused.
@@ -131,52 +131,42 @@ private struct SearchableItemListView: View { // swiftlint:disable:this type_bod
131131
132132 /// The Password Manager download card definition.
133133 private var itemListCardPasswordManagerInstall : some View {
134- ItemListCardView (
135- bodyText: Localizations . storeAllOfYourLoginsAndSyncVerificationCodesDirectlyWithTheAuthenticatorApp,
136- buttonText: Localizations . downloadTheBitwardenApp,
137- leftImage: {
138- Image ( decorative: SharedAsset . Icons. shield24)
139- . foregroundColor ( Asset . Colors. primaryBitwardenLight. swiftUIColor)
140- . frame ( width: 24 , height: 24 )
141- } ,
142- titleText: Localizations . downloadTheBitwardenApp,
143- actionTapped: {
134+ ActionCard (
135+ title: Localizations . downloadTheBitwardenApp,
136+ message: Localizations . storeAllOfYourLoginsAndSyncVerificationCodesDirectlyWithTheAuthenticatorApp,
137+ actionButtonState: ActionCard . ButtonState ( title: Localizations . downloadTheBitwardenApp) {
144138 openURL ( ExternalLinksConstants . passwordManagerLink)
145139 } ,
146- closeTapped: {
147- Task {
148- await store. perform ( . closeCard( . passwordManagerDownload) )
149- }
140+ dismissButtonState: ActionCard . ButtonState ( title: Localizations . close) {
141+ await store. perform ( . closeCard( . passwordManagerDownload) )
150142 } ,
151- )
143+ ) {
144+ Image ( decorative: SharedAsset . Icons. shield24)
145+ . foregroundColor ( SharedAsset . Colors. iconSecondary. swiftUIColor)
146+ . frame ( width: 24 , height: 24 )
147+ }
152148 . padding ( . top, 16 )
153149 }
154150
155151 /// The Password Manager sync card definition.
156152 private var itemListCardSync : some View {
157- ItemListCardView (
158- bodyText: Localizations
159- . allowAuthenticatorAppSyncingInSettingsToViewAllYourVerificationCodesHere,
160- buttonText: Localizations . takeMeToTheAppSettings,
161- leftImage: {
162- Image ( decorative: SharedAsset . Icons. arrowSync24)
163- . foregroundColor ( Asset . Colors. primaryBitwardenLight. swiftUIColor)
164- . frame ( width: 24 , height: 24 )
165- } ,
166- secondaryButtonText: Localizations . learnMore,
167- titleText: Localizations . syncWithTheBitwardenApp,
168- actionTapped: {
153+ ActionCard (
154+ title: Localizations . syncWithTheBitwardenApp,
155+ message: Localizations . allowAuthenticatorAppSyncingInSettingsToViewAllYourVerificationCodesHere,
156+ actionButtonState: ActionCard . ButtonState ( title: Localizations . takeMeToTheAppSettings) {
169157 openURL ( ExternalLinksConstants . passwordManagerSettings)
170158 } ,
171- closeTapped: {
172- Task {
173- await store. perform ( . closeCard( . passwordManagerSync) )
174- }
159+ dismissButtonState: ActionCard . ButtonState ( title: Localizations . close) {
160+ await store. perform ( . closeCard( . passwordManagerSync) )
175161 } ,
176- secondaryActionTapped : {
162+ secondaryButtonState : ActionCard . ButtonState ( title : Localizations . learnMore ) {
177163 openURL ( ExternalLinksConstants . totpSyncHelp)
178164 } ,
179- )
165+ ) {
166+ Image ( decorative: SharedAsset . Icons. arrowSync24)
167+ . foregroundColor ( SharedAsset . Colors. iconSecondary. swiftUIColor)
168+ . frame ( width: 24 , height: 24 )
169+ }
180170 . padding ( . top, 16 )
181171 }
182172
@@ -722,6 +712,36 @@ struct ItemListView_Previews: PreviewProvider { // swiftlint:disable:this type_b
722712 timeProvider: PreviewTimeProvider ( ) ,
723713 )
724714 } . previewDisplayName ( " SharedItems " )
715+
716+ NavigationView {
717+ ItemListView (
718+ store: Store (
719+ processor: StateProcessor (
720+ state: ItemListState (
721+ itemListCardState: . passwordManagerDownload,
722+ loadingState: . data( [ ] ) ,
723+ ) ,
724+ ) ,
725+ ) ,
726+ timeProvider: PreviewTimeProvider ( ) ,
727+ )
728+ }
729+ . previewDisplayName ( " Password Manager Download Card " )
730+
731+ NavigationView {
732+ ItemListView (
733+ store: Store (
734+ processor: StateProcessor (
735+ state: ItemListState (
736+ itemListCardState: . passwordManagerSync,
737+ loadingState: . data( [ ] ) ,
738+ ) ,
739+ ) ,
740+ ) ,
741+ timeProvider: PreviewTimeProvider ( ) ,
742+ )
743+ }
744+ . previewDisplayName ( " Password Manager Sync Card " )
725745 }
726746}
727747#endif
0 commit comments