@applicaster/zapp-react-native-utils 12.0.0-rc.16 → 12.0.0-rc.18

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.
@@ -344,8 +344,16 @@ export const ifElseFocused = R.curry(
344
344
  );
345
345
 
346
346
  export const ifElseSelected = R.curry(
347
- (state: string, selectedValue, defaultValue) =>
348
- state === "selected" ? selectedValue : defaultValue
347
+ (state: string, selectedValue, defaultValue) => {
348
+ switch (state) {
349
+ case "selected":
350
+ return selectedValue;
351
+ case "focused_selected":
352
+ return selectedValue;
353
+ default:
354
+ return defaultValue;
355
+ }
356
+ }
349
357
  );
350
358
 
351
359
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "12.0.0-rc.16",
3
+ "version": "12.0.0-rc.18",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "12.0.0-rc.16",
31
+ "@applicaster/applicaster-types": "12.0.0-rc.18",
32
32
  "buffer": "^5.2.1",
33
33
  "camelize": "^1.0.0",
34
34
  "create-react-context": "^0.2.3",
@@ -68,11 +68,13 @@ export function findComponentByType({
68
68
  * Returns the plugin for a given identifier, if found
69
69
  * @param identifier of the plugin to look for
70
70
  * @param plugins map of the available plugins
71
+ * @param doNotWarn if set to true, will not log a warning if plugin is not found
71
72
  * @return whole plugin if found, undefined otherwise
72
73
  */
73
74
  export function findPluginByIdentifier(
74
75
  identifier: string,
75
- plugins: (QuickBrickPlugin | ZappPlugin | Plugin)[]
76
+ plugins: (QuickBrickPlugin | ZappPlugin | Plugin)[],
77
+ doNotWarn: boolean = false
76
78
  ): (QuickBrickPlugin | ZappPlugin | Plugin) | undefined {
77
79
  if (!identifier) {
78
80
  return undefined;
@@ -84,10 +86,12 @@ export function findPluginByIdentifier(
84
86
  )(plugins);
85
87
 
86
88
  if (!plugin && identifier !== "river" && identifier !== "hooks") {
87
- pluginUtilsLogger.warning({
88
- message: `Could not find plugin for identifier ${identifier}`,
89
- data: { identifier },
90
- });
89
+ if (!doNotWarn) {
90
+ pluginUtilsLogger.warning({
91
+ message: `Could not find plugin for identifier ${identifier}`,
92
+ data: { identifier },
93
+ });
94
+ }
91
95
  }
92
96
 
93
97
  return plugin;