From 49a306fe7d21c51e26885d6582f58ed9cf71326c Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Mon, 6 Jan 2025 11:35:30 +0100 Subject: [PATCH 1/5] Add grey variant of the magnifying glass icon --- .../Classes/Extensions/UIImage+Woo.swift | 4 ++++ .../Contents.json | 22 ++++++++++++++++++ .../magnifying-glass-not-found-dark.pdf | Bin 0 -> 10917 bytes .../magnifying-glass-not-found-light.pdf | Bin 0 -> 10920 bytes 4 files changed, 26 insertions(+) create mode 100644 WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/Contents.json create mode 100644 WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/magnifying-glass-not-found-dark.pdf create mode 100644 WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/magnifying-glass-not-found-light.pdf diff --git a/WooCommerce/Classes/Extensions/UIImage+Woo.swift b/WooCommerce/Classes/Extensions/UIImage+Woo.swift index 7545fd365f4..462e115474b 100644 --- a/WooCommerce/Classes/Extensions/UIImage+Woo.swift +++ b/WooCommerce/Classes/Extensions/UIImage+Woo.swift @@ -1351,6 +1351,10 @@ extension UIImage { UIImage(imageLiteralResourceName: "magnifying-glass-not-found") } + static var magnifyingGlassNotFoundGrey: UIImage { + UIImage(imageLiteralResourceName: "magnifying-glass-not-found-grey") + } + static var groupedProductsImage: UIImage { UIImage(named: "grouped-products")! } diff --git a/WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/Contents.json b/WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/Contents.json new file mode 100644 index 00000000000..6f0d14543ec --- /dev/null +++ b/WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "filename" : "magnifying-glass-not-found-light.pdf", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "magnifying-glass-not-found-dark.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/magnifying-glass-not-found-dark.pdf b/WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/magnifying-glass-not-found-dark.pdf new file mode 100644 index 0000000000000000000000000000000000000000..80382e5900e39972d77eeee44342d6cc9cddf121 GIT binary patch literal 10917 zcmeHNc{o&U*f*AFQpgrkgCy(B!3?94eaX^Tl0q7c%)|_4CX*#Zsrs4S)I68UBjE${n%*LPjt@{i|_Irq7@=YF2^oVo7b^*f>{4J~OvMga^4ATS8Q z1_y>f4jqC(RUJtfS3H`8fj~7d=drdJV{J96i8`QKSelJ`b)=d#Ft!9c%$h|XgFj1h zfXKoT3Tqleh#XZ?Rt6JEt{Aivm=a$YiA8aC^3)RCX0J(uKqsp!0}LYR@&lxkFZnp8 z?hKV{YsAmfkld0t;R`7F0#lHk3avAoLMh)8T zp2&UkD67odYc#(5L*loTWx7y2g9gkso#koj8S7*28g^WQbBtT-{g5ujeAxazCa)Sd zzbS&-uKcp#o|xM0-*%8pp9swI>^xbqjQUo=MOkE($&cr)?lB)4WJywq<`Lj;R4W#w zJB0jxkjJaGoNEsoUG?#O-e(srr2!qYI4NBYNMpDQI4RuM8Bx8Er;D}mm&CXfbwB?#!Ivkk>%kw6Lyz!UOh)O$_9M{}Cd~ld!nrlHa;8Jr{G&&yUsL!~6Px$5f znwvH_z#zII8q~P!y&zBU@yGmV!TT3GbR31xA1-3|VClZ{>B%fwJMXpPZo}5qi99N^Y$OUuu&97W)^&&ZOm2Bh;fcNA!x0(}xY z1$8=lQn%9#sgJZMQTtk+Z_1QzlTmG^YbI`tOq0!+#QMIczs|JCRK_DOHEjLmG&v=! zOu`y&U1&sBnF;5&dSM~0>y&#cxJ!gwP@1{mIwLhxGaA(<#@oW91RauTw5He(Fl;xk zF%>blt#}4pi{pPCdn&dv78}b9hhhzJnGPlAL~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hKvjCf1*d`aY$%SolVVhjoCKtBJg>750l)HLYkb!Vy<`qRXhs@9Sc5B?6q2?HiT0%z4diG7D;E<3H1XVuw2FFY zx2yge1lT`HP;CeeHLYQxe{|VULa7v*s-v?5`oB*7quh<)pQJTtw!V^oOZPLS_9yMO zvb$>=L!Isiw+L+T8ng{s`^F7e#flp|8&n;DsGERk7h59O1x(w?vqUhIy5Smxe?cD` z+=!g)#(W!)b%im(;|U}p#Dd1^QODX+QRuTjKDsl&*kRHCU4D?3X@iDbIWIrpt2zNs z!r-Y>t}OhA7DXdDNf2NKT~bT=d4o2tRz^gPV?H7W8!{y)*s(x+IARlc&s0egr z$Rd!`QfXsDr6Bu~CI*zo`HijJB;mdjT*2_NPkjx19iBagxGsEg!^ z#yVnL!L+lWt3f>p2Z#hGj5y=~)=qr&I6#dF1nOB>|DS-GVBIma$F}k|pzMudA literal 0 HcmV?d00001 diff --git a/WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/magnifying-glass-not-found-light.pdf b/WooCommerce/Resources/Images.xcassets/magnifying-glass-not-found-grey.imageset/magnifying-glass-not-found-light.pdf new file mode 100644 index 0000000000000000000000000000000000000000..29103159eef636e99e3f2cc471abdd205f23e58f GIT binary patch literal 10920 zcmeI2c{r3`*vH9|CKAb#Xi$Wh8O$&#S;m%aEJ>C$7#YjVU?#F;Ey_}neJ7E~kC2^^ zCCU=ni})3ZvWqG245IY=z3=s2*Sq}V{4vk{+~=J8Ip;j*%yoaR?{f@^P!WTOO9KE9 zAQ*_Vumu2tr%nMu3ibrF6Bb2413?J%6^tcXPgRjzMJ^x}45f~IwI^32(3UtW^hS*) z8he>w1C)Tmq&Ga;KuNMCCkJpQIH6Gv0N41!NDT5oFM9*dWg$e2n)*Ub8Gl> zm;B`S1NfiWR@3bP(gn)1_fQr2o5>o&xGV`h)V%k#GaL zE`>8nACrUHpqb32%pvjz+RWR8IO)PshqCu@*F=I3EO^rlAzcq1X3nUc7&3L0Hl;sb zn=xd)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0 HcmV?d00001 From 0fdd04cd2c81bcccfacb004b9fa653d8cf633d1f Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Mon, 6 Jan 2025 11:35:53 +0100 Subject: [PATCH 2/5] Update empty illustration of few dashboard cards --- .../Dashboard/ProductStock/ProductStockDashboardCard.swift | 2 +- .../ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift | 2 +- .../Dashboard/TopPerformers/TopPerformersEmptyView.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/ProductStock/ProductStockDashboardCard.swift b/WooCommerce/Classes/ViewRelated/Dashboard/ProductStock/ProductStockDashboardCard.swift index 8c23e71980c..c9a58268a97 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/ProductStock/ProductStockDashboardCard.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/ProductStock/ProductStockDashboardCard.swift @@ -171,7 +171,7 @@ private extension ProductStockDashboardCard { var emptyView: some View { VStack(alignment: .center, spacing: Layout.padding) { - Image(uiImage: .noStoreImage) + Image(uiImage: .magnifyingGlassNotFoundGrey) Text(String(format: Localization.emptyStateTitle, viewModel.selectedStockType.displayedName)) .subheadlineStyle() diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift b/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift index 03885d23656..32b6b8d832a 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift @@ -140,7 +140,7 @@ private extension StoreStatsChart { Spacer() } .overlay { - Image(.magnifyingGlassNotFound) + Image(.magnifyingGlassNotFoundGrey) .opacity(Constants.EmptyChartOverlay.opacity) .padding(.bottom, Constants.EmptyChartOverlay.bottomPadding) } diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/TopPerformers/TopPerformersEmptyView.swift b/WooCommerce/Classes/ViewRelated/Dashboard/TopPerformers/TopPerformersEmptyView.swift index 5d95fec96e9..a88d3004fc8 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/TopPerformers/TopPerformersEmptyView.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/TopPerformers/TopPerformersEmptyView.swift @@ -5,7 +5,7 @@ import SwiftUI struct TopPerformersEmptyView: View { var body: some View { VStack(alignment: .center, spacing: Layout.defaultSpacing) { - Image(uiImage: .noStoreImage) + Image(uiImage: .magnifyingGlassNotFoundGrey) Text(Localization.text) .subheadlineStyle() } From a404404d40128c9811bc2a29a715d1f49014b38b Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Mon, 6 Jan 2025 12:41:50 +0100 Subject: [PATCH 3/5] Update performance card empty state UI --- .../StoreStats/StorePerformanceView.swift | 78 +++++++++++-------- .../StoreStats/StoreStatsChart.swift | 26 ------- 2 files changed, 44 insertions(+), 60 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StorePerformanceView.swift b/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StorePerformanceView.swift index 1a58b93ce70..ff5be2c38f6 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StorePerformanceView.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StorePerformanceView.swift @@ -160,50 +160,58 @@ private extension StorePerformanceView { } } + @ViewBuilder var statsView: some View { - VStack(spacing: Layout.padding) { - VStack(spacing: Layout.contentVerticalSpacing) { - if let selectedDateText = viewModel.selectedDateText { - Text(selectedDateText) - .font(Font(StyleManager.statsTitleFont)) - } + if viewModel.hasRevenue { + VStack(spacing: Layout.padding) { + VStack(spacing: Layout.contentVerticalSpacing) { + if let selectedDateText = viewModel.selectedDateText { + Text(selectedDateText) + .font(Font(StyleManager.statsTitleFont)) + } - Text(viewModel.revenueStatsText) - .fontWeight(.semibold) - .foregroundStyle(statsValueColor) - .largeTitleStyle() - .accessibilityIdentifier("revenue-value") + Text(viewModel.revenueStatsText) + .fontWeight(.semibold) + .foregroundStyle(statsValueColor) + .largeTitleStyle() + .accessibilityIdentifier("revenue-value") - Text(Localization.revenue) - .if(!viewModel.hasRevenue) { $0.foregroundStyle(Color(.textSubtle)) } - .font(Font(StyleManager.statsTitleFont)) - } + Text(Localization.revenue) + .if(!viewModel.hasRevenue) { $0.foregroundStyle(Color(.textSubtle)) } + .font(Font(StyleManager.statsTitleFont)) + } - HStack(alignment: .bottom) { - Group { - statsItemView(title: Localization.orders, - value: viewModel.orderStatsText, - redactMode: .none) + HStack(alignment: .bottom) { + Group { + statsItemView(title: Localization.orders, + value: viewModel.orderStatsText, + redactMode: .none) .frame(maxWidth: .infinity) - statsItemView(title: Localization.visitors, - value: viewModel.visitorStatsText, - redactMode: .withIcon) + statsItemView(title: Localization.visitors, + value: viewModel.visitorStatsText, + redactMode: .withIcon) .frame(maxWidth: .infinity) - statsItemView(title: Localization.conversion, - value: viewModel.conversionStatsText, - redactMode: .withoutIcon) + statsItemView(title: Localization.conversion, + value: viewModel.conversionStatsText, + redactMode: .withoutIcon) .frame(maxWidth: .infinity) - + } } - .renderedIf(viewModel.hasRevenue) - - Text(Localization.noRevenueText) - .subheadlineStyle() - .frame(maxWidth: .infinity) - .renderedIf(!viewModel.hasRevenue) } + } else { + emptyStatsView + } + } + + var emptyStatsView: some View { + VStack(spacing: Layout.emptyViewSpacing) { + Image(.magnifyingGlassNotFoundGrey) + + Text(Localization.noRevenueText) + .subheadlineStyle() + .frame(maxWidth: .infinity) } } @@ -262,7 +270,8 @@ private extension StorePerformanceView { @ViewBuilder var chartView: some View { - if let chartViewModel = viewModel.chartViewModel { + if let chartViewModel = viewModel.chartViewModel, + chartViewModel.hasRevenue { VStack { StoreStatsChart(viewModel: chartViewModel) { selectedIndex in viewModel.trackInteraction() @@ -325,6 +334,7 @@ private extension StorePerformanceView { static let redactedViewIconSize: CGFloat = 14 static let redactedViewIconOffset = CGSize(width: 16, height: 0) static let hideIconVerticalPadding: CGFloat = 8 + static let emptyViewSpacing: CGFloat = 24 } enum Localization { diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift b/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift index 32b6b8d832a..8f27189da03 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/StoreStats/StoreStatsChart.swift @@ -93,7 +93,6 @@ struct StoreStatsChart: View { } } .padding(Constants.chartPadding) - .if(!viewModel.hasRevenue) { $0.overlay { emptyChartOverlay } } } private func updateSelectedDate(at location: CGPoint, proxy: ChartProxy, geometry: GeometryProxy) { @@ -128,26 +127,6 @@ struct StoreStatsChart: View { } } -private extension StoreStatsChart { - var emptyChartOverlay: some View { - // Simulate an empty chart - VStack { - Divider() - Spacer() - Divider() - Spacer() - Divider() - Spacer() - } - .overlay { - Image(.magnifyingGlassNotFoundGrey) - .opacity(Constants.EmptyChartOverlay.opacity) - .padding(.bottom, Constants.EmptyChartOverlay.bottomPadding) - } - .renderedIf(!viewModel.hasRevenue) - } -} - private extension StoreStatsChart { enum Localization { static let xValue = NSLocalizedString( @@ -190,11 +169,6 @@ private extension StoreStatsChart { ) static let chartGradientBottomColor = Color.clear static let chartPadding: CGFloat = 8 - - enum EmptyChartOverlay { - static let opacity: CGFloat = 0.5 - static let bottomPadding: CGFloat = 32 - } } } From 3378fe342e8fa373df1478c66aee908589af3760 Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Mon, 6 Jan 2025 12:45:42 +0100 Subject: [PATCH 4/5] Update spacing on the top performers empty UI --- .../Dashboard/TopPerformers/TopPerformersEmptyView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/TopPerformers/TopPerformersEmptyView.swift b/WooCommerce/Classes/ViewRelated/Dashboard/TopPerformers/TopPerformersEmptyView.swift index a88d3004fc8..6b7604e6847 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/TopPerformers/TopPerformersEmptyView.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/TopPerformers/TopPerformersEmptyView.swift @@ -4,7 +4,7 @@ import SwiftUI /// Contains a placeholder image and text. struct TopPerformersEmptyView: View { var body: some View { - VStack(alignment: .center, spacing: Layout.defaultSpacing) { + VStack(alignment: .center, spacing: Layout.spacing) { Image(uiImage: .magnifyingGlassNotFoundGrey) Text(Localization.text) .subheadlineStyle() @@ -22,8 +22,8 @@ private extension TopPerformersEmptyView { } enum Layout { - static let defaultSpacing: CGFloat = 10 - static let padding: EdgeInsets = .init(top: 0, leading: defaultSpacing, bottom: defaultSpacing, trailing: defaultSpacing) + static let spacing: CGFloat = 24 + static let padding: EdgeInsets = .init(top: 0, leading: 10, bottom: 10, trailing: 10) } } From 07882e33c0c88ca93b90891eeca0e0d597ecbff3 Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Mon, 6 Jan 2025 18:30:15 +0100 Subject: [PATCH 5/5] Update stock card empty illustration --- .../Dashboard/ProductStock/ProductStockDashboardCard.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/ProductStock/ProductStockDashboardCard.swift b/WooCommerce/Classes/ViewRelated/Dashboard/ProductStock/ProductStockDashboardCard.swift index c9a58268a97..29a7b82b37a 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/ProductStock/ProductStockDashboardCard.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/ProductStock/ProductStockDashboardCard.swift @@ -171,7 +171,7 @@ private extension ProductStockDashboardCard { var emptyView: some View { VStack(alignment: .center, spacing: Layout.padding) { - Image(uiImage: .magnifyingGlassNotFoundGrey) + Image(uiImage: .productBlouseImage) Text(String(format: Localization.emptyStateTitle, viewModel.selectedStockType.displayedName)) .subheadlineStyle()