Sesame-iOS/Sesame-Watch Watch App/Settings/SettingsNumberItemLink.swift

31 lines
761 B
Swift
Raw Permalink Normal View History

2023-08-09 16:29:18 +02:00
import SwiftUI
2024-05-25 16:08:51 +02:00
struct SettingsNumberItemLink<Value>: View where Value: FixedWidthInteger {
2023-08-09 16:29:18 +02:00
let title: String
@Binding
2024-05-25 16:08:51 +02:00
var value: Value
2023-08-09 16:29:18 +02:00
let footnote: String
var body: some View {
NavigationLink {
SettingsNumberInputView(
title: title,
value: $value,
footnote: footnote
)
} label: {
SettingsListTextItem(title: title, value: "\(value)")
}
.buttonStyle(PlainButtonStyle())
}
}
struct SettingsNumberItemLink_Previews: PreviewProvider {
static var previews: some View {
SettingsNumberItemLink(title: "Title", value: .constant(0), footnote: "Some more text explaining the purpose of the text field.")
}
}