Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added note to input asset #189

Merged
merged 4 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ios/packages/demo/Sources/MockFlows.swift
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,13 @@ static let inputBasic: String = """
"type": "text",
"value": "This is an input"
}
},
aarianasingh marked this conversation as resolved.
Show resolved Hide resolved
"note": {
"asset": {
"id": "input-note",
"type": "text",
"value": "This is a note"
}
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ struct InfoAssetView: View {
@ViewBuilder
var body: some View {
VStack {
model.data.title?.asset?.view.font(.title)
model.data.subTitle?.asset?.view.font(.subheadline)
model.data.title?.asset?.view.font(.title).padding(.bottom, 40)
model.data.subTitle?.asset?.view.font(.subheadline).padding(.bottom, 40)
model.data.primaryInfo?.asset?.view
if let actions = model.data.actions?.compactMap { $0.asset } {
ForEach(actions) { action in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public struct InputData: AssetData, Equatable {
var dataType: DataType?
/// A validation if present on the input
var validation: ValidationData?
/// An asset to use as a note for this asset
var note: WrappedAsset?
}

/**
Expand Down Expand Up @@ -87,7 +89,7 @@ struct InputAssetView: View {
@ViewBuilder
var body: some View {
VStack(alignment: .leading) {
model.data.label?.asset?.view.foregroundColor(Color(red: 0.729, green: 0.745, blue: 0.773)).padding(.bottom, 0)
model.data.label?.asset?.view.foregroundColor(Color(red: 0.102, green: 0.125, blue: 0.173)).padding(.bottom, 8).font(.headline)
TextField(
model.data.placeholder ?? "",
text: $model.text,
Expand All @@ -109,6 +111,7 @@ struct InputAssetView: View {
ValidationView(message: data.message, severity: data.severity, dismiss: dismissFunction)
.accessibility(identifier: "\(model.data.id)-validation")
}
model.data.note?.asset?.view.foregroundColor(Color(red: 0.729, green: 0.745, blue: 0.773)).padding(.top, 8).font(.subheadline)
}
}
}
7 changes: 7 additions & 0 deletions plugins/reference-assets/mocks/input/input-basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@
"type": "text",
"value": "This is an input"
}
},
"note": {
"asset": {
"id": "input-note",
"type": "text",
"value": "This is a note"
}
}
}