From b0ff4489a9967210188d6a5c0745015526a1b339 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Sun, 18 Jun 2017 11:35:27 -0700 Subject: [PATCH] [fix] Switch compatibility with React Native Add compatibility support for React Native's 'Switch' props --- .../__snapshots__/index-test.js.snap | 8 +++--- src/components/Switch/index.js | 25 +++++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/components/Switch/__tests__/__snapshots__/index-test.js.snap b/src/components/Switch/__tests__/__snapshots__/index-test.js.snap index 630bf2fe..01df8163 100644 --- a/src/components/Switch/__tests__/__snapshots__/index-test.js.snap +++ b/src/components/Switch/__tests__/__snapshots__/index-test.js.snap @@ -6,7 +6,7 @@ exports[`components/Switch disabled when "false" a default checkbox is rendered style="height:20px;width:40px;" >
minWidth ? styleWidth : minWidth; const trackBorderRadius = multiplyStyleLengthValue(height, 0.5); - const trackCurrentColor = value ? activeTrackColor : trackColor; - const thumbCurrentColor = value ? activeThumbColor : thumbColor; + const trackCurrentColor = value ? onTintColor || activeTrackColor : tintColor || trackColor; + const thumbCurrentColor = value ? activeThumbColor : thumbTintColor || thumbColor; const thumbHeight = height; const thumbWidth = thumbHeight; @@ -167,7 +176,7 @@ const styles = StyleSheet.create({ height: '70%', margin: 'auto', transitionDuration: '0.1s', - width: '90%' + width: '100%' }, disabledTrack: { backgroundColor: '#D5D5D5'