Skip to content

Commit 026e9da

Browse files
authored
Merge pull request #8197 from woocommerce/issue/8148-accessibility
2 parents 7847e73 + 28241b7 commit 026e9da

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ final class AnalyticsHubHostingViewController: UIHostingController<AnalyticsHubV
2020
///
2121
struct AnalyticsHubView: View {
2222

23+
/// Environment safe areas
24+
@Environment(\.safeAreaInsets) var safeAreaInsets: EdgeInsets
25+
2326
@StateObject var viewModel: AnalyticsHubViewModel
2427

2528
var body: some View {
@@ -29,6 +32,7 @@ struct AnalyticsHubView: View {
2932
Divider()
3033
Text("Placeholder for Time Range Selection")
3134
.padding(.leading)
35+
.padding(.horizontal, insets: safeAreaInsets)
3236
.frame(maxWidth: .infinity, minHeight: 84, alignment: .leading)
3337
.background(Color(uiColor: .listForeground))
3438

@@ -40,7 +44,8 @@ struct AnalyticsHubView: View {
4044
Divider()
4145

4246
AnalyticsReportCard(viewModel: viewModel.revenueCard)
43-
.background(Color(uiColor: .listForeground))
47+
.padding(.horizontal, insets: safeAreaInsets)
48+
.background(Color(uiColor: .listForeground))
4449

4550
Divider()
4651
}
@@ -49,7 +54,8 @@ struct AnalyticsHubView: View {
4954
Divider()
5055

5156
AnalyticsReportCard(viewModel: viewModel.ordersCard)
52-
.background(Color(uiColor: .listForeground))
57+
.padding(.horizontal, insets: safeAreaInsets)
58+
.background(Color(uiColor: .listForeground))
5359

5460
Divider()
5561
}
@@ -60,6 +66,7 @@ struct AnalyticsHubView: View {
6066
.navigationTitle(Localization.title)
6167
.navigationBarTitleDisplayMode(.inline)
6268
.background(Color(uiColor: .listBackground))
69+
.edgesIgnoringSafeArea(.horizontal)
6370
}
6471
}
6572

0 commit comments

Comments
 (0)