vector-im/element-ios/issues/5114 - Added UI for creating undisclosed polls and logic for displaying them in the timeline.

This commit is contained in:
Stefan Ceriu
2022-01-13 15:57:26 +02:00
committed by Stefan Ceriu
parent 3e3719d13a
commit eff1d8c81c
27 changed files with 443 additions and 157 deletions

View File

@@ -20,10 +20,10 @@ import Foundation
import SwiftUI
struct PollDetails {
let type: PollEditFormType
let question: String
let answerOptions: [String]
let maxSelections: UInt = 1
let disclosed: Bool = true
}
enum PollEditFormMode {
@@ -51,6 +51,11 @@ enum PollEditFormViewModelResult {
case update(PollDetails)
}
enum PollEditFormType {
case disclosed
case undisclosed
}
struct PollEditFormQuestion {
var text: String {
didSet {
@@ -93,6 +98,7 @@ struct PollEditFormViewState: BindableState {
struct PollEditFormViewStateBindings {
var question: PollEditFormQuestion
var answerOptions: [PollEditFormAnswerOption]
var type: PollEditFormType
var alertInfo: PollEditFormErrorAlertInfo?
}