Skip to content

Commit 9c54452

Browse files
author
Giorgio Ruscigno
committed
Update JetpackPromptView, add padding and tweak line spacing
1 parent d9f5c7a commit 9c54452

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

WordPress/Jetpack/Classes/NUX/New Landing Screen/Views/JetpackPromptView.swift

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,27 @@ struct JetpackPromptView: View {
66
let fontSize: CGFloat
77
var body: some View {
88
Text(data.text)
9-
.font(.system(size: fontSize, weight: .bold))
9+
.font(makeFont())
1010
.foregroundColor(data.color)
1111
.bold()
1212
.lineLimit(Constants.lineLimit)
1313
.padding(Constants.textInsets)
1414
}
1515

16+
private func makeFont() -> Font {
17+
if #available(iOS 14.0, *) {
18+
return .system(size: fontSize, weight: .bold).leading(.tight)
19+
} else {
20+
return .system(size: fontSize, weight: .bold)
21+
}
22+
}
23+
1624
private enum Constants {
1725
static let lineLimit = 2
18-
static let textInsets = EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16)
26+
static let textInsets = EdgeInsets(top: 4, leading: 16, bottom: 4, trailing: 16)
1927
}
2028

21-
/// Used to determine the available width for the text in this view
22-
static var totalHorizontalPadding: CGFloat {
23-
Constants.textInsets.leading + Constants.textInsets.trailing
24-
}
29+
/// Used to determine the available width and height for the text in this view
30+
static let totalHorizontalPadding = Constants.textInsets.leading + Constants.textInsets.trailing
31+
static let totalVerticalPadding = Constants.textInsets.top + Constants.textInsets.bottom
2532
}

0 commit comments

Comments
 (0)