@ledgerhq/native-ui 0.34.1-next.0 → 0.35.0-nightly.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/cta/QuickAction/QuickActionList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAY,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,OAA0B,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,YAAY,CAAC,GAAG;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,eAAe,8DAOlB,oBAAoB,KAAG,MAAM,YA2B/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/cta/QuickAction/QuickActionList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAY,aAAa,EAAQ,MAAM,cAAc,CAAC;AAE7D,OAA0B,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,YAAY,CAAC,GAAG;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,eAAe,8DAOlB,oBAAoB,KAAG,MAAM,YA6B/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,9 +1,16 @@
1
1
  import React, { useCallback } from "react";
2
- import { FlatList } from "react-native";
2
+ import { FlatList, View } from "react-native";
3
3
  import QuickActionButton from "../QuickActionButton";
4
4
  const QuickActionList = ({ numColumns = 3, data, id, testID, isActive = false, ...otherProps }) => {
5
5
  const renderItem = useCallback(({ item, index }) => {
6
- return (React.createElement(QuickActionButton, { ...item, isActive: isActive, flex: 1, mr: (index + 1) % numColumns > 0 && data && index !== data.length - 1 ? 4 : 0, mb: data?.length && index + numColumns < data.length ? 4 : 0, testID: testID }));
6
+ const isNotLastColumn = (index + 1) % numColumns > 0;
7
+ const isNotLastItem = data && index !== data.length - 1;
8
+ const hasButtonToItsRight = isNotLastColumn && isNotLastItem;
9
+ const hasRowBelow = data?.length && index + numColumns < data.length;
10
+ const mr = hasButtonToItsRight ? 4 : 0;
11
+ const mb = hasRowBelow ? 4 : 0;
12
+ return (React.createElement(View, { style: { flex: 1, minHeight: 30 } },
13
+ React.createElement(QuickActionButton, { ...item, isActive: isActive, mr: mr, mb: mb, testID: testID })));
7
14
  }, []);
8
15
  return (React.createElement(FlatList, { ...otherProps, data: data, keyExtractor: (_item, index) => `${id}${index}`, horizontal: false, renderItem: renderItem, numColumns: numColumns }));
9
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.34.1-next.0",
3
+ "version": "0.35.0-nightly.0",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,7 +39,7 @@
39
39
  "react-native-modal": "^13.0.0",
40
40
  "rn-range-slider": "2.1.1",
41
41
  "styled-system": "^5.1.5",
42
- "@ledgerhq/crypto-icons-ui": "^1.14.0-next.0",
42
+ "@ledgerhq/crypto-icons-ui": "^1.14.0",
43
43
  "@ledgerhq/icons-ui": "^0.10.0",
44
44
  "@ledgerhq/ui-shared": "^0.3.0"
45
45
  },