Skip to content
Snippets Groups Projects
Commit a3e67c1f authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add GroupAuthStatusView

parent 39107629
No related branches found
No related tags found
2 merge requests!153Release 1.1.0,!149[Messenger example] create new group
import SwiftUI
import XXModels
public struct GroupAuthStatusView: View {
public init(_ authStatus: XXModels.Group.AuthStatus) {
self.authStatus = authStatus
}
public var authStatus: XXModels.Group.AuthStatus
public var body: some View {
switch authStatus {
case .pending:
HStack {
Text("Pending")
Spacer()
Image(systemName: "envelope.badge")
}
case .deleting:
HStack {
Text("Deleting")
Spacer()
ProgressView()
}
case .participating:
HStack {
Text("Participating")
Spacer()
Image(systemName: "checkmark")
}
case .hidden:
HStack {
Text("Hidden")
Spacer()
Image(systemName: "eye.slash")
}
}
}
}
#if DEBUG
struct GroupAuthStatusView_Previews: PreviewProvider {
static var previews: some View {
NavigationView {
Form {
Section { GroupAuthStatusView(.pending) }
Section { GroupAuthStatusView(.deleting) }
Section { GroupAuthStatusView(.participating) }
Section { GroupAuthStatusView(.hidden) }
}
}
}
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment