commit ea0e28d2c577c46fde82cab6708ef0743d6b3ce8
parent a1e620f72109914ed12baca7860f9864a41a1182
Author: William Casarin <jb55@jb55.com>
Date: Sat, 2 Jul 2022 12:31:22 -0700
nav: use back chevron in more places
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
4 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/damus/Views/CreateAccountView.swift b/damus/Views/CreateAccountView.swift
@@ -101,6 +101,17 @@ struct BackNav: View {
}
}
+struct BackNavBasic: View {
+ @Environment(\.dismiss) var dismiss
+
+ var body: some View {
+ Image(systemName: "chevron.backward")
+ .onTapGesture {
+ self.dismiss()
+ }
+ }
+}
+
extension View {
func placeholder<Content: View>(
when shouldShow: Bool,
diff --git a/damus/Views/DMChatView.swift b/damus/Views/DMChatView.swift
@@ -117,6 +117,8 @@ struct DMChatView: View {
}
}
.toolbar { Header }
+ .navigationBarBackButtonHidden(true)
+ .navigationBarItems(leading: BackNavBasic())
}
}
diff --git a/damus/Views/ProfileView.swift b/damus/Views/ProfileView.swift
@@ -147,6 +147,8 @@ struct ProfileView: View {
followers.unsubscribe()
// our profilemodel needs a bit more help
}
+ .navigationBarBackButtonHidden(true)
+ .navigationBarItems(leading: BackNavBasic())
}
}
diff --git a/damus/Views/SearchView.swift b/damus/Views/SearchView.swift
@@ -25,6 +25,8 @@ struct SearchView: View {
.onDisappear() {
search.unsubscribe()
}
+ .navigationBarBackButtonHidden(true)
+ .navigationBarItems(leading: BackNavBasic())
}
}