Skip to content

Commit

Permalink
refactor: Replace Switch component's deprecated props
Browse files Browse the repository at this point in the history
The props we use to set the colors of the Switch component
`onTintColor` and `tintColor` are now deprecated.

Using the new `trackColor` property we set the exact same values
to preserve the exact style we had before.
  • Loading branch information
borisyankov committed Sep 29, 2018
1 parent 9bf361b commit f8496c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/common/ZulipSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ export default class ZulipSwitch extends PureComponent<Props, State> {
return (
<Switch
value={switchValue}
onTintColor={BRAND_COLOR}
tintColor="rgba(220, 220, 220, 1)"
trackColor={{
false: 'rgba(220, 220, 220, 1)',
true: BRAND_COLOR,
}}
onValueChange={this.handleValueChange}
disabled={disabled}
/>
Expand Down

0 comments on commit f8496c4

Please sign in to comment.