File tree 3 files changed +17
-5
lines changed
3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
3
- enum BuildSettingsEnvironment {
3
+ public enum BuildSettingsEnvironment : Sendable {
4
4
case live
5
5
case preview
6
6
case test
7
7
8
- static let current : BuildSettingsEnvironment = {
8
+ public static let current : BuildSettingsEnvironment = {
9
9
#if DEBUG
10
10
let processInfo = ProcessInfo . processInfo
11
11
if processInfo. isXcodePreview {
Original file line number Diff line number Diff line change @@ -8,21 +8,21 @@ public enum UIAppColor {
8
8
///
9
9
/// - note: The Jetpack app uses
10
10
public static var tint : UIColor {
11
- switch BuildSettings . current. brand {
11
+ switch AppBrand . current {
12
12
case . wordpress: primary
13
13
case . jetpack: UIColor . label
14
14
}
15
15
}
16
16
17
17
public static var primary : UIColor {
18
- switch BuildSettings . current. brand {
18
+ switch AppBrand . current {
19
19
case . wordpress: UIColor ( light: CSColor . Blue. base, dark: primary ( . shade40) )
20
20
case . jetpack: UIColor ( light: CSColor . JetpackGreen. shade ( . shade40) , dark: CSColor . JetpackGreen. shade ( . shade30) )
21
21
}
22
22
}
23
23
24
24
public static func primary( _ shade: ColorStudioShade ) -> UIColor {
25
- switch BuildSettings . current. brand {
25
+ switch AppBrand . current {
26
26
case . wordpress: CSColor . Blue. shade ( shade)
27
27
case . jetpack: CSColor . JetpackGreen. shade ( shade)
28
28
}
Original file line number Diff line number Diff line change
1
+ import Foundation
2
+ import BuildSettingsKit
3
+
4
+ extension AppBrand {
5
+ static var current : AppBrand {
6
+ // TODO: remove this when unit tests not longer rely on `BuildSettings.current`.
7
+ if BuildSettingsEnvironment . current == . test {
8
+ return . jetpack
9
+ }
10
+ return BuildSettings . current. brand
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments