Skip to content

Commit

Permalink
Revert "Use same variable for status bar color as frontend (#2757)"
Browse files Browse the repository at this point in the history
This reverts commit 71e5dd8.
  • Loading branch information
bgoncal authored May 8, 2024
1 parent b8780f7 commit 66bb013
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion Sources/App/Resources/WebSocketBridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const notifyThemeColors = () => {

[
'--app-header-background-color',
'--app-theme-color',
'--primary-background-color',
'--text-primary-color',
'--primary-color',
Expand Down
2 changes: 0 additions & 2 deletions Sources/App/Utilities/ThemeColors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ public struct ThemeColors: Codable {
public enum Color: String, CaseIterable {
// these are in WebSocketBridge.js in this repo (we inject it)
case appHeaderBackgroundColor = "--app-header-background-color"
case appThemeColor = "--app-theme-color"
case primaryBackgroundColor = "--primary-background-color"
case textPrimaryColor = "--text-primary-color"
case primaryColor = "--primary-color"
Expand Down Expand Up @@ -78,7 +77,6 @@ private extension ThemeColors.Color {
case .primaryBackgroundColor: return UIColor(red: 0.98, green: 0.98, blue: 0.98, alpha: 1.0)
case .primaryColor: return UIColor.white
case .textPrimaryColor: return UIColor.white
case .appThemeColor: return UIColor(red: 0.01, green: 0.66, blue: 0.96, alpha: 1.0)
}
}
}
4 changes: 2 additions & 2 deletions Sources/App/WebView/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,12 @@ final class WebViewController: UIViewController, WKNavigationDelegate, WKUIDeleg
webView?.scrollView.backgroundColor = cachedColors[.primaryBackgroundColor]

if let statusBarView = view.viewWithTag(111) {
statusBarView.backgroundColor = cachedColors[.appThemeColor]
statusBarView.backgroundColor = cachedColors[.appHeaderBackgroundColor]
}

refreshControl.tintColor = cachedColors[.primaryColor]

let headerBackgroundIsLight = cachedColors[.appThemeColor].isLight
let headerBackgroundIsLight = cachedColors[.appHeaderBackgroundColor].isLight
underlyingPreferredStatusBarStyle = headerBackgroundIsLight ? .darkContent : .lightContent

setNeedsStatusBarAppearanceUpdate()
Expand Down

0 comments on commit 66bb013

Please sign in to comment.