Skip to content

Commit

Permalink
chore: got rid unnecessary navigation background modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
rnr committed Jan 15, 2024
1 parent 4abf9ac commit 0667023
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
9 changes: 0 additions & 9 deletions Core/Core/Extensions/ViewExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,6 @@ public extension View {
}
}
}

func navigationBackground(color: UIColor) -> some View {
return self.introspect(
.navigationView(style: .stack),
on: .iOS(.v15...),
scope: .ancestor) {
$0.navigationBar.barTintColor = color
}
}

func hideScrollContentBackground() -> some View {
if #available(iOS 16.0, *) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public struct CourseContainerView: View {
.navigationBarBackButtonHidden(false)
.navigationTitle(titleBar())
.onChange(of: selection, perform: didSelect)
.navigationBackground(color: Theme.UIColors.background)
.background(Theme.Colors.background)
}

Expand Down
6 changes: 2 additions & 4 deletions Theme/Theme/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,17 @@ public struct Theme {
}
}

// Use this structure where the computed Color.uiColor() extension is not appropriate.
public struct UIColors {
public private(set) static var textPrimary = ThemeAssets.textPrimary.color
public private(set) static var accentColor = ThemeAssets.accentColor.color
public private(set) static var background = ThemeAssets.background.color

public static func update(
textPrimary: UIColor = ThemeAssets.textPrimary.color,
accentColor: UIColor = ThemeAssets.accentColor.color,
background: UIColor = ThemeAssets.background.color
accentColor: UIColor = ThemeAssets.accentColor.color
) {
self.textPrimary = textPrimary
self.accentColor = accentColor
self.background = background
}
}

Expand Down

0 comments on commit 0667023

Please sign in to comment.