Skip to content

Commit 175f77b

Browse files
committed
Set product card vm from main hub vm
1 parent 156d4a2 commit 175f77b

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
@@ -57,7 +57,7 @@ struct AnalyticsHubView: View {
5757
VStack(spacing: Layout.dividerSpacing) {
5858
Divider()
5959

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

6363
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)