@ledgerhq/native-ui 0.50.0-nightly.20251122023607 → 0.50.0-nightly.20251125023817
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/Form/DrawerTabSelector/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/DrawerTabSelector/index.tsx"],"names":[],"mappings":";AA4DA,UAAU,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAClD,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,cAAc,EAAE,CAAC,CAAC;IAClB,kBAAkB,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IACxC,MAAM,EAAE;SAAG,GAAG,IAAI,CAAC,GAAG,MAAM;KAAE,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EACnE,OAAO,EACP,cAAc,EACd,kBAAkB,EAClB,MAAM,GACP,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CA4DnC"}
|
|
@@ -2,9 +2,9 @@ import React, { useEffect } from "react";
|
|
|
2
2
|
import Text from "../../Text";
|
|
3
3
|
import Flex from "../../Layout/Flex";
|
|
4
4
|
import styled, { useTheme } from "styled-components/native";
|
|
5
|
-
import {
|
|
5
|
+
import { Pressable } from "react-native";
|
|
6
6
|
import Animated, { useSharedValue, useAnimatedStyle, withSpring } from "react-native-reanimated";
|
|
7
|
-
const
|
|
7
|
+
const StyledPressable = styled(Pressable) `
|
|
8
8
|
width: ${(p) => p.width}px;
|
|
9
9
|
flex: 1;
|
|
10
10
|
height: 100%;
|
|
@@ -23,7 +23,10 @@ const StyledText = styled(Text) `
|
|
|
23
23
|
`;
|
|
24
24
|
const OptionButton = ({ option, selectedOption, handleSelectOption, label, width, }) => {
|
|
25
25
|
const isSelected = selectedOption === option;
|
|
26
|
-
|
|
26
|
+
const onPress = () => {
|
|
27
|
+
handleSelectOption(option);
|
|
28
|
+
};
|
|
29
|
+
return (React.createElement(StyledPressable, { width: width, onPressIn: onPress, hitSlop: 16 },
|
|
27
30
|
React.createElement(StyledFlex, { isSelected: isSelected },
|
|
28
31
|
React.createElement(StyledText, { fontWeight: "semiBold", isSelected: isSelected, numberOfLines: 1 }, label))));
|
|
29
32
|
};
|
|
@@ -34,13 +37,13 @@ export default function DrawerTabSelector({ options, selectedOption, handleSelec
|
|
|
34
37
|
const margin = 20;
|
|
35
38
|
const width = labels[longuestLabel].length * widthFactor + margin;
|
|
36
39
|
const semiWidth = width / 2;
|
|
37
|
-
const translateX = useSharedValue(-semiWidth);
|
|
40
|
+
const translateX = useSharedValue(selectedOption === options[0] ? -semiWidth : semiWidth);
|
|
38
41
|
useEffect(() => {
|
|
39
42
|
translateX.value = withSpring(selectedOption === options[0] ? -semiWidth : semiWidth, {
|
|
40
43
|
damping: 30,
|
|
41
44
|
stiffness: 80,
|
|
42
45
|
});
|
|
43
|
-
}, [selectedOption, translateX, options]);
|
|
46
|
+
}, [selectedOption, translateX, options, semiWidth]);
|
|
44
47
|
const animatedStyle = useAnimatedStyle(() => {
|
|
45
48
|
return {
|
|
46
49
|
transform: [{ translateX: translateX.value }],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.50.0-nightly.
|
|
3
|
+
"version": "0.50.0-nightly.20251125023817",
|
|
4
4
|
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"color": "^4.0.0",
|
|
40
40
|
"rn-range-slider": "2.1.1",
|
|
41
41
|
"styled-system": "^5.1.5",
|
|
42
|
-
"@ledgerhq/crypto-icons-ui": "^1.23.0-nightly.
|
|
43
|
-
"@ledgerhq/icons-ui": "^0.17.0-nightly.
|
|
42
|
+
"@ledgerhq/crypto-icons-ui": "^1.23.0-nightly.20251125023817",
|
|
43
|
+
"@ledgerhq/icons-ui": "^0.17.0-nightly.20251125023817",
|
|
44
44
|
"@ledgerhq/ui-shared": "^0.5.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|