From c1952b00c10e35878d9811afc22382f51b4161ef Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Fri, 30 Sep 2022 02:22:15 +0200 Subject: [PATCH] Add contact ID to MyContactView --- .../Sources/MyContactFeature/MyContactView.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Examples/xx-messenger/Sources/MyContactFeature/MyContactView.swift b/Examples/xx-messenger/Sources/MyContactFeature/MyContactView.swift index f32af242..eca55d62 100644 --- a/Examples/xx-messenger/Sources/MyContactFeature/MyContactView.swift +++ b/Examples/xx-messenger/Sources/MyContactFeature/MyContactView.swift @@ -1,3 +1,4 @@ +import AppCore import ComposableArchitecture import SwiftUI import XXModels @@ -49,8 +50,17 @@ public struct MyContactView: View { public var body: some View { WithViewStore(store, observe: ViewState.init) { viewStore in Form { + Section { + Text(viewStore.contact?.id.hexString ?? "") + .font(.footnote.monospaced()) + .textSelection(.enabled) + } header: { + Label("ID", systemImage: "number") + } + Section { Text(viewStore.contact?.username ?? "") + .textSelection(.enabled) } header: { Label("Username", systemImage: "person") } @@ -59,6 +69,7 @@ public struct MyContactView: View { if let contact = viewStore.contact { if let email = contact.email { Text(email) + .textSelection(.enabled) Button(role: .destructive) { viewStore.send(.unregisterEmailTapped) } label: { @@ -135,6 +146,7 @@ public struct MyContactView: View { if let contact = viewStore.contact { if let phone = contact.phone { Text(phone) + .textSelection(.enabled) Button(role: .destructive) { viewStore.send(.unregisterPhoneTapped) } label: { -- GitLab