fix labels view for mac compilation
This commit is contained in:
@ -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(
|
||||
|
||||
@ -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) }
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user