Skip to content

Commit b0f81d7

Browse files
committed
move child views to private extension
1 parent 1be8119 commit b0f81d7

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Creation/Taxes/NewTaxRateSelectorView.swift

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,7 @@ struct NewTaxRateSelectorView: View {
2323
var body: some View {
2424
NavigationView {
2525
VStack(alignment: .leading, spacing: 0) {
26-
Group {
27-
HStack(alignment: .top, spacing: Layout.explanatoryBoxHorizontalSpacing) {
28-
Image(systemName: "info.circle")
29-
.foregroundColor(Color(.wooCommercePurple(.shade60)))
30-
Text(Localization.infoText)
31-
}
32-
.padding(Layout.generalPadding)
33-
}
34-
.overlay(
35-
RoundedRectangle(cornerRadius: Layout.explanatoryBoxCornerRadius)
36-
.stroke(Color(.separator), lineWidth: 1)
37-
)
38-
.padding(Layout.generalPadding)
26+
taxRateSelectorHeaderView
3927

4028
switch viewModel.syncState {
4129
case .results:
@@ -132,8 +120,26 @@ struct NewTaxRateSelectorView: View {
132120
showingWPAdminWebView = false
133121
})
134122
}
123+
}
135124

136-
private var resultsListFooter: some View {
125+
private extension NewTaxRateSelectorView {
126+
var taxRateSelectorHeaderView: some View {
127+
Group {
128+
HStack(alignment: .top, spacing: Layout.explanatoryBoxHorizontalSpacing) {
129+
Image(systemName: "info.circle")
130+
.foregroundColor(Color(.wooCommercePurple(.shade60)))
131+
Text(Localization.infoText)
132+
}
133+
.padding(Layout.generalPadding)
134+
}
135+
.overlay(
136+
RoundedRectangle(cornerRadius: Layout.explanatoryBoxCornerRadius)
137+
.stroke(Color(.separator), lineWidth: 1)
138+
)
139+
.padding(Layout.generalPadding)
140+
}
141+
142+
var resultsListFooter: some View {
137143
Group {
138144
Text(Localization.listFooterResultsSectionTitle)
139145
.foregroundColor(Color(.textSubtle))
@@ -158,10 +164,9 @@ struct NewTaxRateSelectorView: View {
158164
}
159165
}
160166

161-
private var storeTaxRateBottomView: some View {
167+
var storeTaxRateBottomView: some View {
162168
VStack {
163169
Divider()
164-
165170
Toggle(isOn: $storeSelectedTaxRate) {
166171
VStack(alignment: .leading, spacing: Layout.fixedBottomPanelVerticalSpace) {
167172
Text(Localization.fixedBottomPanelBody)

0 commit comments

Comments
 (0)