Skip to content

Commit

Permalink
ZulipSwitch: Update Switch usage away from 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.

Update to their replacement, the new `trackColor` property, setting
the exact same values to preserve the actual style unchanged.
  • Loading branch information
borisyankov authored and gnprice committed Nov 1, 2018
1 parent e19b299 commit 95f41fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/common/ZulipSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ export default class ZulipSwitch extends PureComponent<Props, State> {
const switchValue = typeof valueControlled !== 'undefined' ? valueControlled : value;

return (
// $FlowFixMe-57 two props deprecated... and immediately removed from type 🤨
<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 95f41fc

Please sign in to comment.