mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 11:02:48 +02:00
Refine InfoView
This commit is contained in:
@@ -27,45 +27,46 @@ struct InfoView: View {
|
||||
private let description: String
|
||||
private let action: Action
|
||||
|
||||
init(title: String, descripion: String, action: Action) {
|
||||
init(title: String, description: String, action: Action) {
|
||||
self.title = title
|
||||
self.description = descripion
|
||||
self.description = description
|
||||
self.action = action
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { proxy in
|
||||
VStack(alignment: .leading, spacing: 24) {
|
||||
VStack(alignment: .leading, spacing: 16) {
|
||||
Text(title)
|
||||
.font(theme.fonts.calloutSB)
|
||||
.foregroundColor(theme.colors.primaryContent)
|
||||
|
||||
Text(description)
|
||||
.font(theme.fonts.footnote)
|
||||
.foregroundColor(theme.colors.primaryContent)
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 24) {
|
||||
VStack(alignment: .leading, spacing: 16) {
|
||||
Text(title)
|
||||
.font(theme.fonts.calloutSB)
|
||||
.foregroundColor(theme.colors.primaryContent)
|
||||
.accessibilityIdentifier(title)
|
||||
|
||||
Button(action: action.action) {
|
||||
Text(action.text)
|
||||
.font(theme.fonts.bodySB)
|
||||
.foregroundColor(theme.colors.background)
|
||||
.frame(height: 48)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.background(theme.colors.accent)
|
||||
.cornerRadius(8)
|
||||
Text(description)
|
||||
.font(theme.fonts.footnote)
|
||||
.foregroundColor(theme.colors.primaryContent)
|
||||
.accessibilityIdentifier(description)
|
||||
}
|
||||
.padding(24)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
|
||||
Button(action: action.action) {
|
||||
Text(action.text)
|
||||
.font(theme.fonts.bodySB)
|
||||
.foregroundColor(theme.colors.background)
|
||||
.frame(height: 48)
|
||||
.frame(maxWidth: .infinity)
|
||||
.accessibilityIdentifier(action.text)
|
||||
}
|
||||
.background(theme.colors.accent)
|
||||
.cornerRadius(8)
|
||||
}
|
||||
.padding(24)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
struct InfoView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
InfoView(title: "Verified sessions",
|
||||
descripion: "Verified sessions have logged in with your credentials and then been verified, either using your secure passphrase or by cross-verifying.\n\nThis means they hold encryption keys for your previous messages, and confirm to other users you are communicating with that these sessions are really you.",
|
||||
description: "Verified sessions have logged in with your credentials and then been verified, either using your secure passphrase or by cross-verifying.\n\nThis means they hold encryption keys for your previous messages, and confirm to other users you are communicating with that these sessions are really you.",
|
||||
action: .init(text: "GOT IT", action: {}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user