Skip to content

Commit 83976de

Browse files
committed
Set product card vm from main hub vm
1 parent 6bc4795 commit 83976de

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/AnalyticsHubView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct AnalyticsHubView: View {
6363
VStack(spacing: Layout.dividerSpacing) {
6464
Divider()
6565

66-
AnalyticsProductCard(itemsSold: "2,342", delta: "+23%", deltaBackgroundColor: .withColorStudio(.green, shade: .shade50))
66+
AnalyticsProductCard(viewModel: viewModel.productCard)
6767
.background(Color(uiColor: .listForeground))
6868

6969
Divider()

WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/AnalyticsHubViewModel.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ final class AnalyticsHubViewModel: ObservableObject {
4646
trailingDelta: "-16%",
4747
trailingDeltaColor: .withColorStudio(.red, shade: .shade40))
4848

49+
/// Products Card ViewModel
50+
///
51+
@Published var productCard = AnalyticsProductCardViewModel(itemsSold: "3,234",
52+
delta: "+43%",
53+
deltaBackgroundColor: .withColorStudio(.green, shade: .shade50))
54+
4955
// MARK: Private data
5056

5157
/// Order stats for the current selected time period

0 commit comments

Comments
 (0)