Skip to content

Commit 7567ad5

Browse files
author
Giorgio Ruscigno
committed
Add JetpackPromptView, a view that contains a single prompt of the new Jetpack prologue screen
1 parent 8e36c0e commit 7567ad5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
import SwiftUI
3+
4+
struct JetpackPromptView: View {
5+
let data: JetpackPrompt
6+
let fontSize: CGFloat
7+
var body: some View {
8+
Text(data.text)
9+
.font(.system(size: fontSize, weight: .bold))
10+
.foregroundColor(data.color)
11+
.bold()
12+
.lineLimit(Constants.lineLimit)
13+
.padding(Constants.textInsets)
14+
}
15+
16+
private enum Constants {
17+
static let lineLimit = 2
18+
static let textInsets = EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16)
19+
}
20+
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+
}
25+
}

0 commit comments

Comments
 (0)