@applicaster/zapp-react-native-ui-components 16.0.0-rc.66 → 16.0.0-rc.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,13 +16,7 @@ type Props = {
16
16
  export const Toggle = (props: Props) => {
17
17
  const { style, item, action, cellState } = props;
18
18
 
19
- const {
20
- trackColor,
21
- trackColorActive,
22
- thumbColor,
23
- thumbColorActive,
24
- iosBackgroundColor,
25
- } = style;
19
+ const { trackColor, trackColorActive, thumbColor, thumbColorActive } = style;
26
20
 
27
21
  // `focused_selected` is the selected state with a finger on the row, so the
28
22
  // switch has to read as on for both. Leaving it out reads a pressed selected
@@ -73,7 +67,6 @@ export const Toggle = (props: Props) => {
73
67
  <Switch
74
68
  trackColor={{ false: trackColor, true: trackColorActive }}
75
69
  thumbColor={isSelected ? thumbColorActive : thumbColor}
76
- ios_backgroundColor={iosBackgroundColor}
77
70
  onValueChange={onPress}
78
71
  value={isSelected}
79
72
  />
@@ -25,7 +25,6 @@ const style = {
25
25
  trackColorActive: "rgba(4,207,153,1)",
26
26
  thumbColor: "rgba(255,255,255,1)",
27
27
  thumbColorActive: "rgba(255,255,255,1)",
28
- iosBackgroundColor: "rgba(0,0,0,1)",
29
28
  } as any;
30
29
 
31
30
  const item = { id: "true", title: "I agree" } as any;
@@ -87,10 +86,6 @@ describe("Toggle with an empty action identifier", () => {
87
86
  expect(mockInitialEntryState).not.toHaveBeenCalled();
88
87
  });
89
88
 
90
- // ios_backgroundColor paints behind the track, so trackColor does not cover
91
- // it and it has to be forwarded on its own. It was dropped once while the
92
- // destructure feeding it was being reformatted, and nothing caught that.
93
- //
94
89
  // Asserted on the Switch element rather than the rendered host component:
95
90
  // what Toggle owns is the props it hands to Switch, and React Native rewrites
96
91
  // them into platform-specific ones (tintColor, a style entry) underneath.
@@ -100,9 +95,18 @@ describe("Toggle with an empty action identifier", () => {
100
95
  expect(UNSAFE_getByType(Switch).props).toMatchObject({
101
96
  trackColor: { false: style.trackColor, true: style.trackColorActive },
102
97
  thumbColor: style.thumbColor,
103
- ios_backgroundColor: style.iosBackgroundColor,
104
98
  });
105
99
  });
100
+
101
+ // ios_backgroundColor paints an opaque layer behind the track that the track
102
+ // color cannot cover, which on iOS reads as a halo around the switch. The
103
+ // switch is left on its platform default instead, so the prop must stay
104
+ // unset even if a style happens to carry a color for it.
105
+ it("does not set an iOS background color on the switch", () => {
106
+ const { UNSAFE_getByType } = renderToggle("", "default");
107
+
108
+ expect(UNSAFE_getByType(Switch).props.ios_backgroundColor).toBeUndefined();
109
+ });
106
110
  });
107
111
 
108
112
  describe("Toggle with an action plugin identifier", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "16.0.0-rc.66",
3
+ "version": "16.0.0-rc.67",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "16.0.0-rc.66",
32
- "@applicaster/zapp-react-native-bridge": "16.0.0-rc.66",
33
- "@applicaster/zapp-react-native-redux": "16.0.0-rc.66",
34
- "@applicaster/zapp-react-native-utils": "16.0.0-rc.66",
31
+ "@applicaster/applicaster-types": "16.0.0-rc.67",
32
+ "@applicaster/zapp-react-native-bridge": "16.0.0-rc.67",
33
+ "@applicaster/zapp-react-native-redux": "16.0.0-rc.67",
34
+ "@applicaster/zapp-react-native-utils": "16.0.0-rc.67",
35
35
  "fast-json-stable-stringify": "^2.1.0",
36
36
  "promise": "^8.3.0",
37
37
  "react-native-sortables": "1.7.1",