@@ -10,6 +10,9 @@ struct SendItemAccessCountStepper: View {
10
10
/// The number of times the send has been accessed.
11
11
let currentAccessCount : Int ?
12
12
13
+ /// Whether the maximum access count info text should be displayed in the footer.
14
+ let displayInfoText : Bool
15
+
13
16
/// A binding for changing the maximum access account for the send in the stepper.
14
17
@Binding var maximumAccessCount : Int
15
18
@@ -28,9 +31,11 @@ struct SendItemAccessCountStepper: View {
28
31
. foregroundStyle ( Asset . Colors. textPrimary. swiftUIColor)
29
32
} footer: {
30
33
VStack ( alignment: . leading, spacing: 2 ) {
31
- Text ( Localizations . maximumAccessCountInfo)
32
- . styleGuide ( . footnote)
33
- . foregroundColor ( Asset . Colors. textSecondary. swiftUIColor)
34
+ if displayInfoText {
35
+ Text ( Localizations . maximumAccessCountInfo)
36
+ . styleGuide ( . footnote)
37
+ . foregroundColor ( Asset . Colors. textSecondary. swiftUIColor)
38
+ }
34
39
35
40
if let currentAccessCount {
36
41
// Wrap these texts in a group so that the style guide can be set on
@@ -48,6 +53,21 @@ struct SendItemAccessCountStepper: View {
48
53
. accessibilityIdentifier ( " SendMaxAccessCountEntry " )
49
54
}
50
55
}
56
+
57
+ // MARK: Initialization
58
+
59
+ /// Initialize a `SendItemAccessCountStepper`.
60
+ ///
61
+ /// - Parameters:
62
+ /// - currentAccessCount: The number of times the send has been accessed.
63
+ /// - displayInfoText: Whether the maximum access count info text should be displayed in the footer.
64
+ /// - maximumAccessCount: A binding for changing the maximum access account for the send in the stepper.
65
+ ///
66
+ init ( currentAccessCount: Int ? , displayInfoText: Bool = true , maximumAccessCount: Binding < Int > ) {
67
+ self . currentAccessCount = currentAccessCount
68
+ self . displayInfoText = displayInfoText
69
+ _maximumAccessCount = maximumAccessCount
70
+ }
51
71
}
52
72
53
73
// MARK: - Previews
0 commit comments