diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift index 142e51043..24633a1e5 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/LabelsView.swift @@ -2,6 +2,7 @@ import Combine import Models import Services import SwiftUI +import Utils import Views struct LabelsView: View { @@ -153,13 +154,13 @@ struct CreateLabelView: View { } .padding() .toolbar { - ToolbarItem(placement: .navigationBarLeading) { + ToolbarItem(placement: .barLeading) { Button( action: { viewModel.showCreateEmailModal = false }, label: { Text("Cancel").foregroundColor(.appGrayTextContrast) } ) } - ToolbarItem(placement: .navigationBarTrailing) { + ToolbarItem(placement: .barTrailing) { Button( action: { viewModel.createLabel( diff --git a/apple/OmnivoreKit/Sources/Views/Colors/Colors.swift b/apple/OmnivoreKit/Sources/Views/Colors/Colors.swift index 03c20e65d..bdd97a4ad 100644 --- a/apple/OmnivoreKit/Sources/Views/Colors/Colors.swift +++ b/apple/OmnivoreKit/Sources/Views/Colors/Colors.swift @@ -22,6 +22,7 @@ public extension Color { static var systemBackground: Color { Color(.systemBackground) } static var systemPlaceholder: Color { Color(.placeholderText) } static var secondarySystemGroupedBackground: Color { Color(.secondarySystemGroupedBackground) } + static var systemGray6: Color { Color(.systemGray6) } static var systemLabel: Color { if #available(iOS 15.0, *) { return Color(uiColor: .label) @@ -34,6 +35,7 @@ public extension Color { static var systemBackground: Color { Color(.windowBackgroundColor) } static var systemPlaceholder: Color { Color(.placeholderTextColor) } static var systemLabel: Color { Color(.labelColor) } + static var systemGray6: Color { Color(NSColor.systemGray) } // Just for compilation. secondarySystemGroupedBackground shouldn't be used on macOS static var secondarySystemGroupedBackground: Color { Color(.windowBackgroundColor) } diff --git a/apple/OmnivoreKit/Sources/Views/TextChip.swift b/apple/OmnivoreKit/Sources/Views/TextChip.swift index 83ee595a9..c07ce3463 100644 --- a/apple/OmnivoreKit/Sources/Views/TextChip.swift +++ b/apple/OmnivoreKit/Sources/Views/TextChip.swift @@ -33,7 +33,7 @@ public struct TextChip: View { public struct TextChipButton: View { public static func makeAddLabelButton(onTap: @escaping () -> Void) -> TextChipButton { - TextChipButton(title: "Labels", color: Color(.systemGray6), actionType: .show, onTap: onTap) + TextChipButton(title: "Labels", color: .systemGray6, actionType: .show, onTap: onTap) } public static func makeShowOptionsButton(title: String, onTap: @escaping () -> Void) -> TextChipButton { diff --git a/apple/OmnivoreKit/Sources/Views/Utils/ToolbarItemPlacementExtension.swift b/apple/OmnivoreKit/Sources/Views/Utils/ToolbarItemPlacementExtension.swift new file mode 100644 index 000000000..f4800a5d1 --- /dev/null +++ b/apple/OmnivoreKit/Sources/Views/Utils/ToolbarItemPlacementExtension.swift @@ -0,0 +1,19 @@ +import SwiftUI + +public extension ToolbarItemPlacement { + static var barLeading: ToolbarItemPlacement { + #if os(iOS) + .navigationBarLeading + #else + .automatic + #endif + } + + static var barTrailing: ToolbarItemPlacement { + #if os(iOS) + .navigationBarTrailing + #else + .automatic + #endif + } +}