Skip to content

Commit 5e5e527

Browse files
committed
Set product card vm from main hub vm
1 parent 78c667f commit 5e5e527

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
@@ -61,7 +61,7 @@ struct AnalyticsHubView: View {
6161
VStack(spacing: Layout.dividerSpacing) {
6262
Divider()
6363

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

6767
Divider()

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ final class AnalyticsHubViewModel: ObservableObject {
5353
currentRangeSubtitle: "Jan 1 - Nov 23, 2022",
5454
previousRangeSubtitle: "Jan 1 - Nov 23, 2021")
5555

56+
/// Products Card ViewModel
57+
///
58+
@Published var productCard = AnalyticsProductCardViewModel(itemsSold: "3,234",
59+
delta: "+43%",
60+
deltaBackgroundColor: .withColorStudio(.green, shade: .shade50))
61+
5662
// MARK: Private data
5763

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

0 commit comments

Comments
 (0)