Skip to content

Commit d3f71c6

Browse files
committed
Move layout numbers to constants from CR suggestions.
1 parent c2c3e9b commit d3f71c6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Domains/DomainSettingsView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct DomainSettingsView: View {
2727

2828
var body: some View {
2929
ScrollView {
30-
VStack(alignment: .leading, spacing: 36) {
30+
VStack(alignment: .leading, spacing: Layout.contentSpacing) {
3131
if let freeDomain = viewModel.freeStagingDomain {
3232
HStack {
3333
FreeStagingDomainView(domain: freeDomain)
@@ -43,7 +43,7 @@ struct DomainSettingsView: View {
4343
// TODO: 8558 - show domain list with search domain action
4444
}
4545
}
46-
.padding(.init(top: 39, leading: 16, bottom: 16, trailing: 16))
46+
.padding(Layout.contentPadding)
4747
}
4848
.safeAreaInset(edge: .bottom) {
4949
if viewModel.domains.isEmpty {
@@ -55,7 +55,7 @@ struct DomainSettingsView: View {
5555
// TODO: 8558 - search domain action
5656
}
5757
.buttonStyle(PrimaryButtonStyle())
58-
.padding(Layout.defaultPadding)
58+
.padding(Layout.bottomContentPadding)
5959
}
6060
.background(Color(.systemBackground))
6161
}
@@ -81,7 +81,9 @@ private extension DomainSettingsView {
8181
private extension DomainSettingsView {
8282
enum Layout {
8383
static let dividerHeight: CGFloat = 1
84-
static let defaultPadding: EdgeInsets = .init(top: 10, leading: 16, bottom: 10, trailing: 16)
84+
static let bottomContentPadding: EdgeInsets = .init(top: 10, leading: 16, bottom: 10, trailing: 16)
85+
static let contentPadding: EdgeInsets = .init(top: 39, leading: 16, bottom: 16, trailing: 16)
86+
static let contentSpacing: CGFloat = 36
8587
}
8688
}
8789

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Domains/FreeStagingDomainView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ struct FreeStagingDomainView: View {
55
let domain: DomainSettingsViewModel.FreeStagingDomain
66

77
var body: some View {
8-
VStack(alignment: .leading, spacing: 8) {
8+
VStack(alignment: .leading, spacing: Layout.contentSpacing) {
99
VStack(alignment: .leading, spacing: 0) {
1010
Text(Localization.freeDomainTitle)
1111
Text(domain.name)
@@ -45,6 +45,7 @@ private extension FreeStagingDomainView {
4545
static let horizontalPadding: CGFloat = 6
4646
static let verticalPadding: CGFloat = 4
4747
static let cornerRadius: CGFloat = 8
48+
static let contentSpacing: CGFloat = 8
4849
}
4950
}
5051

0 commit comments

Comments
 (0)