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

Add contact ID to MyContactView

parent 13bc70ac
Branches
Tags
2 merge requests!112Restore contacts from backup,!102Release 1.0.0
import AppCore
import ComposableArchitecture import ComposableArchitecture
import SwiftUI import SwiftUI
import XXModels import XXModels
...@@ -49,8 +50,17 @@ public struct MyContactView: View { ...@@ -49,8 +50,17 @@ public struct MyContactView: View {
public var body: some View { public var body: some View {
WithViewStore(store, observe: ViewState.init) { viewStore in WithViewStore(store, observe: ViewState.init) { viewStore in
Form { Form {
Section {
Text(viewStore.contact?.id.hexString ?? "")
.font(.footnote.monospaced())
.textSelection(.enabled)
} header: {
Label("ID", systemImage: "number")
}
Section { Section {
Text(viewStore.contact?.username ?? "") Text(viewStore.contact?.username ?? "")
.textSelection(.enabled)
} header: { } header: {
Label("Username", systemImage: "person") Label("Username", systemImage: "person")
} }
...@@ -59,6 +69,7 @@ public struct MyContactView: View { ...@@ -59,6 +69,7 @@ public struct MyContactView: View {
if let contact = viewStore.contact { if let contact = viewStore.contact {
if let email = contact.email { if let email = contact.email {
Text(email) Text(email)
.textSelection(.enabled)
Button(role: .destructive) { Button(role: .destructive) {
viewStore.send(.unregisterEmailTapped) viewStore.send(.unregisterEmailTapped)
} label: { } label: {
...@@ -135,6 +146,7 @@ public struct MyContactView: View { ...@@ -135,6 +146,7 @@ public struct MyContactView: View {
if let contact = viewStore.contact { if let contact = viewStore.contact {
if let phone = contact.phone { if let phone = contact.phone {
Text(phone) Text(phone)
.textSelection(.enabled)
Button(role: .destructive) { Button(role: .destructive) {
viewStore.send(.unregisterPhoneTapped) viewStore.send(.unregisterPhoneTapped)
} label: { } label: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment