RedditWebBackBar.swift 960 B

123456789101112131415161718192021222324252627282930313233
  1. import SwiftUI
  2. struct RedditWebBackBar: View {
  3. let canGoBack: Bool
  4. let onBack: () -> Void
  5. var body: some View {
  6. HStack(spacing: 0) {
  7. Button(action: onBack) {
  8. HStack(spacing: 5) {
  9. Image(systemName: "chevron.left")
  10. .font(.system(size: 12, weight: .semibold))
  11. Text("Back")
  12. .font(.system(size: 13, weight: .medium))
  13. }
  14. }
  15. .buttonStyle(AppSecondaryButtonStyle())
  16. .disabled(!canGoBack)
  17. .opacity(canGoBack ? 1 : 0.4)
  18. .padding(.leading, 12)
  19. .padding(.vertical, 8)
  20. Spacer(minLength: 0)
  21. }
  22. .frame(maxWidth: .infinity)
  23. .background(AppTheme.panelBackground)
  24. .overlay(alignment: .bottom) {
  25. Rectangle()
  26. .fill(AppTheme.border)
  27. .frame(height: 1)
  28. }
  29. }
  30. }