RedditWebBackBar.swift 1022 B

12345678910111213141516171819202122232425262728293031323334
  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. .foregroundStyle(AppTheme.textPrimary)
  15. .padding(.horizontal, 14)
  16. .padding(.vertical, 9)
  17. }
  18. .buttonStyle(AppPlainButtonStyle())
  19. .disabled(!canGoBack)
  20. .opacity(canGoBack ? 1 : 0.4)
  21. Spacer(minLength: 0)
  22. }
  23. .frame(maxWidth: .infinity)
  24. .background(AppTheme.panelBackground)
  25. .overlay(alignment: .bottom) {
  26. Rectangle()
  27. .fill(AppTheme.border)
  28. .frame(height: 1)
  29. }
  30. }
  31. }