question disappeared
This commit is contained in:
@@ -221,9 +221,33 @@ struct QuestionCard: View {
|
||||
}
|
||||
}
|
||||
|
||||
struct QuestionDetails: View {
|
||||
let item: InboxItem
|
||||
@Environment(Store.self) private var store
|
||||
@Environment(Overlays.self) private var overlays
|
||||
@ViewState private var model: CardModel?
|
||||
@FocusState private var focus: String?
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
if let model {
|
||||
CardBody(model: model, focus: $focus, question: false)
|
||||
Thread(item: item)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.onAppear {
|
||||
if model == nil {
|
||||
model = CardModel(item, store, overlays)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct CardBody: View {
|
||||
let model: CardModel
|
||||
var focus: FocusState<String?>.Binding
|
||||
var question = true
|
||||
@ViewState private var wide = true
|
||||
|
||||
private var contextCtx: MDContext {
|
||||
@@ -239,9 +263,11 @@ private struct CardBody: View {
|
||||
MarkdownView(blocks: model.context, ctx: contextCtx)
|
||||
.onGeometryChange(for: Bool.self) { $0.size.width > 480 } action: { wide = $0 }
|
||||
.padding(.vertical, 10)
|
||||
MarkdownView(blocks: parseMarkdown(jsString(p["question"] ?? "")), ctx: MDContext(taskId: item.taskId))
|
||||
.padding(.top, 10)
|
||||
.padding(.bottom, 4)
|
||||
if question {
|
||||
MarkdownView(blocks: parseMarkdown(jsString(p["question"] ?? "")), ctx: MDContext(taskId: item.taskId))
|
||||
.padding(.top, 10)
|
||||
.padding(.bottom, 4)
|
||||
}
|
||||
WhyLine(text: jsString(p["why_blocked"] ?? ""), taskId: item.taskId)
|
||||
.padding(.bottom, 8)
|
||||
Attachments(list: attachments(p["attachments"] ?? nil), taskId: item.taskId)
|
||||
|
||||
Reference in New Issue
Block a user