New status button

This commit is contained in:
Justin Mazzocchi 2020-12-05 13:42:54 -08:00
parent 43e58bce35
commit 9725fb7d1d
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
1 changed files with 27 additions and 0 deletions

View File

@ -26,6 +26,7 @@ struct TabNavigationView: View {
.accessibility(label: Text(tab.title)) .accessibility(label: Text(tab.title))
} }
.tag(tab) .tag(tab)
.overlay(newStatusButton, alignment: .bottomTrailing)
} }
} }
} }
@ -46,6 +47,9 @@ struct TabNavigationView: View {
} }
private extension TabNavigationView { private extension TabNavigationView {
static let newStatusButtonDimension: CGFloat = 54
static let newStatusButtonShadowRadius: CGFloat = 2
@ViewBuilder @ViewBuilder
var pendingView: some View { var pendingView: some View {
NavigationView { NavigationView {
@ -142,6 +146,29 @@ private extension TabNavigationView {
.padding([.trailing, .top, .bottom]) .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 { private extension Timeline {