mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-21 15:50:59 +00:00
New status button
This commit is contained in:
parent
43e58bce35
commit
9725fb7d1d
1 changed files with 27 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue