From 9725fb7d1da6e114340078e2a8ef656131cc8e7f Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Sat, 5 Dec 2020 13:42:54 -0800 Subject: [PATCH] New status button --- Views/TabNavigationView.swift | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Views/TabNavigationView.swift b/Views/TabNavigationView.swift index baf0c39..2d60ec5 100644 --- a/Views/TabNavigationView.swift +++ b/Views/TabNavigationView.swift @@ -26,6 +26,7 @@ struct TabNavigationView: View { .accessibility(label: Text(tab.title)) } .tag(tab) + .overlay(newStatusButton, alignment: .bottomTrailing) } } } @@ -46,6 +47,9 @@ struct TabNavigationView: View { } private extension TabNavigationView { + static let newStatusButtonDimension: CGFloat = 54 + static let newStatusButtonShadowRadius: CGFloat = 2 + @ViewBuilder var pendingView: some View { NavigationView { @@ -142,6 +146,29 @@ private extension TabNavigationView { .padding([.trailing, .top, .bottom]) } } + + @ViewBuilder + var newStatusButton: some View { + if viewModel.identification.identity.authenticated + && !viewModel.identification.identity.pending { + Button { + + } label: { + ZStack { + Circle() + Image(systemName: "pencil") + .resizable() + .frame( + width: Self.newStatusButtonDimension / 2, + height: Self.newStatusButtonDimension / 2) + .accentColor(.white) + } + .frame(width: Self.newStatusButtonDimension, height: Self.newStatusButtonDimension) + .shadow(radius: Self.newStatusButtonShadowRadius) + .padding() + } + } + } } private extension Timeline {