@coinbase/cds-mobile 8.13.5 → 8.13.6
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.
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@ const _excluded = ["label"],
|
|
|
2
2
|
_excluded2 = ["label"];
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React, { useCallback, useState } from 'react';
|
|
5
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
import { sampleTabs } from '@coinbase/cds-common/internal/data/tabs';
|
|
7
7
|
import { gutter } from '@coinbase/cds-common/tokens/sizing';
|
|
8
8
|
import sample from 'lodash/sample';
|
|
@@ -62,10 +62,18 @@ const TabNavigationScreen = () => {
|
|
|
62
62
|
const [currentTabThree, setCurrentTabThree] = useState();
|
|
63
63
|
const [currentTabFour, setCurrentTabFour] = useState();
|
|
64
64
|
const [currentTabFive, setCurrentTabFive] = useState(enumTabs[0].id);
|
|
65
|
+
const [currentTabSix, setCurrentTabSix] = useState();
|
|
66
|
+
const [dotCount, setDotCount] = useState(0);
|
|
67
|
+
const tabsWithDot = useMemo(() => sampleTabs.map(tab => _extends({}, tab, {
|
|
68
|
+
count: dotCount
|
|
69
|
+
})), [dotCount]);
|
|
65
70
|
const randomizeCurrentTabOne = useCallback(() => {
|
|
66
71
|
const randomTabItem = sample(sampleTabs);
|
|
67
72
|
setCurrentTabOne(randomTabItem == null ? void 0 : randomTabItem.id);
|
|
68
73
|
}, []);
|
|
74
|
+
const randomizeDotCount = useCallback(() => {
|
|
75
|
+
setDotCount(Number(dotCount ? 0 : sample([2, 14, 99, 100])));
|
|
76
|
+
}, [dotCount]);
|
|
69
77
|
return /*#__PURE__*/_jsxs(ExampleScreen, {
|
|
70
78
|
children: [/*#__PURE__*/_jsxs(Example, {
|
|
71
79
|
overflow: "visible",
|
|
@@ -128,6 +136,18 @@ const TabNavigationScreen = () => {
|
|
|
128
136
|
tabs: someCustomTabs,
|
|
129
137
|
value: currentTabFour
|
|
130
138
|
})
|
|
139
|
+
}), /*#__PURE__*/_jsxs(Example, {
|
|
140
|
+
overflow: "visible",
|
|
141
|
+
padding: gutter,
|
|
142
|
+
title: "Tab Navigation with dot count change",
|
|
143
|
+
children: [/*#__PURE__*/_jsx(TabNavigation, {
|
|
144
|
+
onChange: setCurrentTabSix,
|
|
145
|
+
tabs: tabsWithDot,
|
|
146
|
+
value: currentTabSix
|
|
147
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
148
|
+
onPress: randomizeDotCount,
|
|
149
|
+
children: "Randomize dot count"
|
|
150
|
+
})]
|
|
131
151
|
}), /*#__PURE__*/_jsxs(Example, {
|
|
132
152
|
overflow: "visible",
|
|
133
153
|
padding: gutter,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.13.
|
|
3
|
+
"version": "8.13.6",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"react-native-svg": "^14.1.0"
|
|
151
151
|
},
|
|
152
152
|
"dependencies": {
|
|
153
|
-
"@coinbase/cds-common": "^8.13.
|
|
153
|
+
"@coinbase/cds-common": "^8.13.6",
|
|
154
154
|
"@coinbase/cds-icons": "^5.4.1",
|
|
155
155
|
"@coinbase/cds-illustrations": "^4.23.0",
|
|
156
156
|
"@coinbase/cds-lottie-files": "^3.3.1",
|