Skip to content

Commit

Permalink
Remove dynamicColor from remaining demo controllers (#1832)
Browse files Browse the repository at this point in the history
* update remaining demo controllers

* update ReadmeViewController
  • Loading branch information
joannaquu authored Jul 19, 2023
1 parent ec59692 commit 01aacfc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -947,9 +947,8 @@ class ModalViewController: UITableViewController {

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let tintColor = DynamicColor(light: GlobalTokens.brandColors(.comm80),
dark: GlobalTokens.neutralColors(.white))
navigationItem.rightBarButtonItem?.tintColor = UIColor(dynamicColor: tintColor)
navigationItem.rightBarButtonItem?.tintColor = UIColor(light: GlobalTokens.brandColor(.comm80),
dark: GlobalTokens.neutralColor(.white))
}

override func viewDidLoad() {
Expand Down
24 changes: 12 additions & 12 deletions ios/FluentUI.Demo/FluentUI.Demo/Demos/SearchBarDemoController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ extension SearchBarDemoController: DemoAppearanceDelegate {
private var themeWideOverrideSearchBarTokens: [SearchBarTokenSet.Tokens: ControlTokenValue] {
return [
.backgroundColor: .uiColor {
return UIColor(dynamicColor: DynamicColor(light: GlobalTokens.sharedColors(.berry, .shade30),
dark: GlobalTokens.sharedColors(.berry, .tint40)))
return UIColor(light: GlobalTokens.sharedColor(.berry, .shade30),
dark: GlobalTokens.sharedColor(.berry, .tint40))
},
.textColor: .uiColor {
return UIColor(dynamicColor: DynamicColor(light: GlobalTokens.neutralColors(.white),
dark: GlobalTokens.neutralColors(.grey98)))
return UIColor(light: GlobalTokens.neutralColor(.white),
dark: GlobalTokens.neutralColor(.grey98))
},
.font: .uiFont {
return self.view.fluentTheme.typography(.body1Strong)
Expand All @@ -199,8 +199,8 @@ extension SearchBarDemoController: DemoAppearanceDelegate {
return .green
},
.activeSearchIconColor: .uiColor {
return UIColor(dynamicColor: DynamicColor(light: GlobalTokens.neutralColors(.white),
dark: GlobalTokens.sharedColors(.lime, .tint40)))
return UIColor(light: GlobalTokens.neutralColor(.white),
dark: GlobalTokens.sharedColor(.lime, .tint40))
}
]
}
Expand All @@ -211,19 +211,19 @@ extension SearchBarDemoController: DemoAppearanceDelegate {
return self.view.fluentTheme.color(.dangerBackground1)
},
.textColor: .uiColor {
return UIColor(dynamicColor: DynamicColor(light: GlobalTokens.sharedColors(.lime, .shade30),
dark: GlobalTokens.sharedColors(.lime, .tint40)))
return UIColor(light: GlobalTokens.sharedColor(.lime, .shade30),
dark: GlobalTokens.sharedColor(.lime, .tint40))
},
.cancelButtonColor: .uiColor {
return .red
},
.placeholderColor: .uiColor {
return UIColor(dynamicColor: DynamicColor(light: GlobalTokens.sharedColors(.berry, .shade30),
dark: GlobalTokens.sharedColors(.berry, .tint40)))
return UIColor(light: GlobalTokens.sharedColor(.berry, .shade30),
dark: GlobalTokens.sharedColor(.berry, .tint40))
},
.inactiveSearchIconColor: .uiColor {
return UIColor(dynamicColor: DynamicColor(light: GlobalTokens.sharedColors(.lime, .shade30),
dark: GlobalTokens.sharedColors(.lime, .tint40)))
return UIColor(light: GlobalTokens.sharedColor(.lime, .shade30),
dark: GlobalTokens.sharedColor(.lime, .tint40))
},
.font: .uiFont {
return UIFont(descriptor: .init(name: "Papyrus", size: 12), size: 12)
Expand Down
6 changes: 2 additions & 4 deletions ios/FluentUI.Demo/FluentUI.Demo/ReadmeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ class ReadmeViewController: UIViewController {
private let readmeLabel: Label = {
let label = Label()
label.numberOfLines = 0

// TODO: Change color to fluent 2 tokens
label.textColor = UIColor(dynamicColor: DynamicColor(light: ColorValue(0x000000),
dark: ColorValue(0xFFFFFF)))
label.textColor = UIColor(light: GlobalTokens.neutralColor(.black),
dark: GlobalTokens.neutralColor(.white))
label.translatesAutoresizingMaskIntoConstraints = false
return label
}()
Expand Down

0 comments on commit 01aacfc

Please sign in to comment.