Skip to content

Commit 8f73623

Browse files
committed
Update font in cash text field while maintaining the default style.
1 parent 8852898 commit 8f73623

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/FormattableAmountTextField.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ struct FormattableAmountTextField: View {
2525
.opacity(0)
2626

2727
Text(viewModel.formattedAmount)
28+
.if(style == .pos) {
29+
$0.font(.posHeadingRegular)
30+
}
2831
.font(.system(size: Layout.amountFontSize(size: viewModel.amountTextSize.fontSize, scale: scale), weight: .bold))
2932
.foregroundColor(Color(viewModel.amountTextColor))
3033
.minimumScaleFactor(0.1)
@@ -80,5 +83,12 @@ private extension FormattableAmountTextField {
8083
locale: .current,
8184
storeCurrencySettings: .init(),
8285
allowNegativeNumber: false)
83-
FormattableAmountTextField(viewModel: viewModel, style: .pos)
86+
VStack {
87+
Text("Default style")
88+
FormattableAmountTextField(viewModel: viewModel, style: .default)
89+
}
90+
VStack {
91+
Text("POS style")
92+
FormattableAmountTextField(viewModel: viewModel, style: .pos)
93+
}
8494
}

0 commit comments

Comments
 (0)