react-navigation-reanimated-top-tabs 0.7.0 → 0.8.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.
- package/lib/commonjs/components/ReanimatedTopTab/AnimationHelper.js +1 -1
- package/lib/commonjs/components/ReanimatedTopTab/AnimationHelper.js.map +1 -1
- package/lib/commonjs/components/ReanimatedTopTab/ReanimatedTabView.js +4 -2
- package/lib/commonjs/components/ReanimatedTopTab/ReanimatedTabView.js.map +1 -1
- package/lib/commonjs/components/ReanimatedTopTab/types.js.map +1 -1
- package/lib/commonjs/components/elements/TabBarBaseComponent.js +42 -17
- package/lib/commonjs/components/elements/TabBarBaseComponent.js.map +1 -1
- package/lib/commonjs/components/elements/TabBarBaseItem.js +52 -0
- package/lib/commonjs/components/elements/TabBarBaseItem.js.map +1 -0
- package/lib/commonjs/components/wrappers/GestureWrapper.js +13 -3
- package/lib/commonjs/components/wrappers/GestureWrapper.js.map +1 -1
- package/lib/commonjs/components/wrappers/SectionList.js +72 -0
- package/lib/commonjs/components/wrappers/SectionList.js.map +1 -0
- package/lib/commonjs/context/Context.hooks.js +10 -7
- package/lib/commonjs/context/Context.hooks.js.map +1 -1
- package/lib/commonjs/hooks/useHeader.js +2 -10
- package/lib/commonjs/hooks/useHeader.js.map +1 -1
- package/lib/commonjs/index.js +2 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigator/createReanimatedTopTabNavigator.js +24 -22
- package/lib/commonjs/navigator/createReanimatedTopTabNavigator.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/components/ReanimatedTopTab/AnimationHelper.js +3 -3
- package/lib/module/components/ReanimatedTopTab/AnimationHelper.js.map +1 -1
- package/lib/module/components/ReanimatedTopTab/ReanimatedTabView.js +4 -2
- package/lib/module/components/ReanimatedTopTab/ReanimatedTabView.js.map +1 -1
- package/lib/module/components/ReanimatedTopTab/types.js.map +1 -1
- package/lib/module/components/elements/TabBarBaseComponent.js +44 -19
- package/lib/module/components/elements/TabBarBaseComponent.js.map +1 -1
- package/lib/module/components/elements/TabBarBaseItem.js +45 -0
- package/lib/module/components/elements/TabBarBaseItem.js.map +1 -0
- package/lib/module/components/wrappers/GestureWrapper.js +13 -3
- package/lib/module/components/wrappers/GestureWrapper.js.map +1 -1
- package/lib/module/components/wrappers/SectionList.js +66 -0
- package/lib/module/components/wrappers/SectionList.js.map +1 -0
- package/lib/module/context/Context.hooks.js +10 -7
- package/lib/module/context/Context.hooks.js.map +1 -1
- package/lib/module/hooks/useHeader.js +3 -11
- package/lib/module/hooks/useHeader.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigator/createReanimatedTopTabNavigator.js +25 -23
- package/lib/module/navigator/createReanimatedTopTabNavigator.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/components/ReanimatedTopTab/ReanimatedTabView.d.ts +2 -0
- package/lib/typescript/src/components/ReanimatedTopTab/ReanimatedTabView.d.ts.map +1 -1
- package/lib/typescript/src/components/ReanimatedTopTab/types.d.ts +3 -1
- package/lib/typescript/src/components/ReanimatedTopTab/types.d.ts.map +1 -1
- package/lib/typescript/src/components/elements/TabBarBaseComponent.d.ts +1 -1
- package/lib/typescript/src/components/elements/TabBarBaseComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/elements/TabBarBaseItem.d.ts +14 -0
- package/lib/typescript/src/components/elements/TabBarBaseItem.d.ts.map +1 -0
- package/lib/typescript/src/components/wrappers/GestureWrapper.d.ts.map +1 -1
- package/lib/typescript/src/components/wrappers/SectionList.d.ts +3 -0
- package/lib/typescript/src/components/wrappers/SectionList.d.ts.map +1 -0
- package/lib/typescript/src/context/Context.hooks.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useHeader.d.ts +0 -6
- package/lib/typescript/src/hooks/useHeader.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useScreenProperties.d.ts +1 -1
- package/lib/typescript/src/index.d.ts +3 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigator/createReanimatedTopTabNavigator.d.ts +1 -1
- package/lib/typescript/src/navigator/createReanimatedTopTabNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +8 -4
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ReanimatedTopTab/AnimationHelper.ts +3 -3
- package/src/components/ReanimatedTopTab/ReanimatedTabView.tsx +4 -0
- package/src/components/ReanimatedTopTab/types.ts +3 -1
- package/src/components/elements/TabBarBaseComponent.tsx +53 -19
- package/src/components/elements/TabBarBaseItem.tsx +76 -0
- package/src/components/wrappers/GestureWrapper.tsx +11 -1
- package/src/components/wrappers/SectionList.tsx +75 -0
- package/src/context/Context.hooks.ts +13 -5
- package/src/hooks/useHeader.ts +3 -21
- package/src/index.tsx +2 -0
- package/src/navigator/createReanimatedTopTabNavigator.tsx +30 -26
- package/src/types.ts +18 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useTabContext","
|
|
1
|
+
{"version":3,"names":["useTabContext","withTiming","useHeader","headerHeight","transformationX","hideHeader","value"],"sourceRoot":"../../../src","sources":["hooks/useHeader.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,UAAU,QAAQ,yBAAyB;AAEpD,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC7B,MAAM;IAAEC,YAAY;IAAEC;EAAgB,CAAC,GAAGJ,aAAa,CAAC,CAAC;EAEzD,MAAMK,UAAU,GAAGA,CAAA,KAAM;IACvBD,eAAe,CAACE,KAAK,GAAGL,UAAU,CAAC,CAACE,YAAY,CAACG,KAAK,CAAC;EACzD,CAAC;EAED,OAAO;IAAED;EAAW,CAAC;AACvB,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { ScrollView } from './components/wrappers/ScrollView';
|
|
4
|
+
import { SectionList } from './components/wrappers/SectionList';
|
|
4
5
|
import { ScreenWrapper } from './components/wrappers/ScreenWrapper';
|
|
5
6
|
import { TabBarBaseComponent } from './components/elements/TabBarBaseComponent';
|
|
6
7
|
import { TabBarLabelBaseComponent } from './components/elements/TabBarLabelBaseComponent';
|
|
@@ -29,6 +30,7 @@ export const TabHooks = {
|
|
|
29
30
|
};
|
|
30
31
|
export const Tab = {
|
|
31
32
|
ScrollView,
|
|
33
|
+
SectionList,
|
|
32
34
|
ScreenWrapper,
|
|
33
35
|
TabBarBaseComponent,
|
|
34
36
|
TabBarLabelBaseComponent
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ScrollView","ScreenWrapper","TabBarBaseComponent","TabBarLabelBaseComponent","useEffect","WarningService","useTabContext","useTabOffset","useScreenGesture","useScreenScrollable","useScreenProperties","useHeader","createReanimatedTopTabNavigator","_useTabContext","warn","TabHooks","Tab"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,kCAAkC;AAC7D,SAASC,aAAa,QAAQ,qCAAqC;AACnE,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,SAASC,wBAAwB,QAAQ,gDAAgD;AACzF,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,SAAS,QAAQ,mBAAmB;AAG7C,SAASC,+BAA+B,QAAQ,6CAA6C;AAE7F,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3BT,SAAS,CAAC,MAAM;IACdC,cAAc,CAACS,IAAI,CAAC,CAAC;EACvB,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOR,aAAa,CAAC,CAAC;AACxB,CAAC;AAED,OAAO,MAAMS,QAAQ,GAAG;EACtBJ,SAAS;EACTD,mBAAmB;EACnBD,mBAAmB;EACnBD,gBAAgB;EAChBF,aAAa,EAAEO,cAAc;EAC7BN;AACF,CAAC;AAED,OAAO,MAAMS,GAAG,GAAG;
|
|
1
|
+
{"version":3,"names":["ScrollView","SectionList","ScreenWrapper","TabBarBaseComponent","TabBarLabelBaseComponent","useEffect","WarningService","useTabContext","useTabOffset","useScreenGesture","useScreenScrollable","useScreenProperties","useHeader","createReanimatedTopTabNavigator","_useTabContext","warn","TabHooks","Tab"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,kCAAkC;AAC7D,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,SAASC,aAAa,QAAQ,qCAAqC;AACnE,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,SAASC,wBAAwB,QAAQ,gDAAgD;AACzF,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,SAAS,QAAQ,mBAAmB;AAG7C,SAASC,+BAA+B,QAAQ,6CAA6C;AAE7F,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3BT,SAAS,CAAC,MAAM;IACdC,cAAc,CAACS,IAAI,CAAC,CAAC;EACvB,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOR,aAAa,CAAC,CAAC;AACxB,CAAC;AAED,OAAO,MAAMS,QAAQ,GAAG;EACtBJ,SAAS;EACTD,mBAAmB;EACnBD,mBAAmB;EACnBD,gBAAgB;EAChBF,aAAa,EAAEO,cAAc;EAC7BN;AACF,CAAC;AAED,OAAO,MAAMS,GAAG,GAAG;EACjBjB,UAAU;EACVC,WAAW;EACXC,aAAa;EACbC,mBAAmB;EACnBC;AACF,CAAC","ignoreList":[]}
|
|
@@ -9,9 +9,10 @@ import { useMemo } from 'react';
|
|
|
9
9
|
import Reanimated from 'react-native-reanimated';
|
|
10
10
|
import { ReanimatedTabView } from '../components/ReanimatedTopTab/ReanimatedTabView';
|
|
11
11
|
import { ContextHooks } from '../context/Context.hooks';
|
|
12
|
-
import { jsx as _jsx,
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const TabViewNavigator = ({
|
|
14
14
|
HeaderComponent,
|
|
15
|
+
TopComponent,
|
|
15
16
|
TabBarComponent = TabBarBaseComponent,
|
|
16
17
|
children,
|
|
17
18
|
config,
|
|
@@ -45,8 +46,8 @@ const TabViewNavigator = ({
|
|
|
45
46
|
index: state.index,
|
|
46
47
|
routes: state.routes.map((route, index) => {
|
|
47
48
|
const restOptions = omit(descriptors[route.key]?.options, 'tabBarLabel');
|
|
48
|
-
const tabBarLabel = descriptors[route.key]?.options.tabBarLabel ?
|
|
49
|
-
focused
|
|
49
|
+
const tabBarLabel = descriptors[route.key]?.options.tabBarLabel ? focused => descriptors[route.key]?.options.tabBarLabel?.({
|
|
50
|
+
focused,
|
|
50
51
|
title: descriptors[route.key]?.options.title || route.name,
|
|
51
52
|
index
|
|
52
53
|
}) : undefined;
|
|
@@ -67,26 +68,27 @@ const TabViewNavigator = ({
|
|
|
67
68
|
children: ({
|
|
68
69
|
headerHeight,
|
|
69
70
|
transformationY
|
|
70
|
-
}) => /*#__PURE__*/_jsxs(
|
|
71
|
-
children: [/*#__PURE__*/_jsx(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
}) => /*#__PURE__*/_jsxs(NavigationContent, {
|
|
72
|
+
children: [TopComponent ? /*#__PURE__*/_jsx(TopComponent, {
|
|
73
|
+
transformationY: transformationY
|
|
74
|
+
}) : null, /*#__PURE__*/_jsxs(GestureWrapper, {
|
|
75
|
+
children: [/*#__PURE__*/_jsx(Reanimated.View, {
|
|
76
|
+
onLayout: ({
|
|
77
|
+
nativeEvent
|
|
78
|
+
}) => {
|
|
79
|
+
headerHeight.value = nativeEvent.layout.height;
|
|
80
|
+
},
|
|
81
|
+
children: HeaderComponent ? /*#__PURE__*/_jsx(HeaderComponent, {
|
|
82
|
+
headerHeight: headerHeight,
|
|
83
|
+
transformationY: transformationY
|
|
84
|
+
}) : null
|
|
85
|
+
}), /*#__PURE__*/_jsx(ReanimatedTabView, {
|
|
86
|
+
navigationState: navigationState,
|
|
87
|
+
navigate: navigate,
|
|
88
|
+
renderScene: renderScene,
|
|
89
|
+
renderTabBar: TabBarComponent,
|
|
90
|
+
screenOptions: screenOptions
|
|
91
|
+
})]
|
|
90
92
|
})]
|
|
91
93
|
})
|
|
92
94
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createNavigatorFactory","TabActions","TabRouter","useNavigationBuilder","GestureWrapper","TabBarBaseComponent","Provider","omit","useMemo","Reanimated","ReanimatedTabView","ContextHooks","jsx","_jsx","
|
|
1
|
+
{"version":3,"names":["createNavigatorFactory","TabActions","TabRouter","useNavigationBuilder","GestureWrapper","TabBarBaseComponent","Provider","omit","useMemo","Reanimated","ReanimatedTabView","ContextHooks","jsx","_jsx","jsxs","_jsxs","TabViewNavigator","HeaderComponent","TopComponent","TabBarComponent","children","config","initialRouteName","screenOptions","NavigationContent","descriptors","navigation","state","defaultScreenOptions","_config","routes","map","context","usePrepareContext","navigate","index","route","dispatch","jumpTo","name","navigationState","restOptions","key","options","tabBarLabel","focused","title","undefined","renderScene","render","headerHeight","transformationY","View","onLayout","nativeEvent","value","layout","height","renderTabBar","createReanimatedTopTabNavigator"],"sourceRoot":"../../../src","sources":["navigator/createReanimatedTopTabNavigator.tsx"],"mappings":"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","ignoreList":[]}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ReanimatedTopTabNavigation"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["ReanimatedTopTabNavigation"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;WAaiBA,0BAA0B","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ReanimatedTopTabNavigation } from 'react-navigation-reanimated-top-tabs';
|
|
2
3
|
import type { ReanimatedTabViewTypes } from './types';
|
|
3
4
|
export interface ReanimatedTabViewProps {
|
|
4
5
|
LazyPlaceholder?: () => React.ReactNode;
|
|
@@ -9,6 +10,7 @@ export interface ReanimatedTabViewProps {
|
|
|
9
10
|
renderScene: (params: ReanimatedTabViewTypes.SceneProps) => React.ReactNode;
|
|
10
11
|
renderTabBar?: (params: ReanimatedTabViewTypes.RenderTabsParams) => React.ReactNode;
|
|
11
12
|
navigate(index: number): void;
|
|
13
|
+
screenOptions?: ReanimatedTopTabNavigation.NavigationOptions;
|
|
12
14
|
}
|
|
13
15
|
export declare const ReanimatedTabView: React.NamedExoticComponent<ReanimatedTabViewProps>;
|
|
14
16
|
//# sourceMappingURL=ReanimatedTabView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReanimatedTabView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ReanimatedTopTab/ReanimatedTabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ReanimatedTabView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ReanimatedTopTab/ReanimatedTabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAiBvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAEvF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,eAAe,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,sBAAsB,CAAC,eAAe,CAAC;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,sBAAsB,CAAC,qBAAqB,CAAC;IACrE,WAAW,EAAE,CAAC,MAAM,EAAE,sBAAsB,CAAC,UAAU,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5E,YAAY,CAAC,EAAE,CACb,MAAM,EAAE,sBAAsB,CAAC,gBAAgB,KAC5C,KAAK,CAAC,SAAS,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,CAAC,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;CAC9D;AAED,eAAO,MAAM,iBAAiB,oDAwK7B,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SharedValue } from 'react-native-reanimated';
|
|
3
|
+
import type { ReanimatedTopTabNavigation } from 'react-navigation-reanimated-top-tabs';
|
|
3
4
|
export declare namespace ReanimatedTabViewTypes {
|
|
4
5
|
interface Route {
|
|
5
6
|
key: string;
|
|
6
7
|
name: string;
|
|
7
|
-
tabBarLabel?: () => React.ReactNode;
|
|
8
|
+
tabBarLabel?: (focused: boolean) => React.ReactNode;
|
|
8
9
|
title?: string;
|
|
9
10
|
}
|
|
10
11
|
type NavigationState = {
|
|
@@ -15,6 +16,7 @@ export declare namespace ReanimatedTabViewTypes {
|
|
|
15
16
|
navigationState: NavigationState;
|
|
16
17
|
position: SharedValue<number>;
|
|
17
18
|
navigate(index: number): void;
|
|
19
|
+
screenOptions?: ReanimatedTopTabNavigation.NavigationOptions;
|
|
18
20
|
}
|
|
19
21
|
interface SceneProps {
|
|
20
22
|
jumpTo?: (key: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ReanimatedTopTab/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ReanimatedTopTab/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAEvF,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,KAAK;QACpB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;QACpD,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;IAED,KAAY,eAAe,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,EAAE,CAAA;KAAE,CAAC;IAEjE,UAAiB,gBAAgB;QAC/B,eAAe,EAAE,eAAe,CAAC;QACjC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,aAAa,CAAC,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;KAC9D;IAED,UAAiB,UAAU;QACzB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC;KACd;IAED,KAAY,qBAAqB,GAAG;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC3E"}
|
|
@@ -5,5 +5,5 @@ export interface TabBarProps extends ReanimatedTabViewTypes.RenderTabsParams {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
style?: AnimatedStyle;
|
|
7
7
|
}
|
|
8
|
-
export declare const TabBarBaseComponent: ({ children, navigationState, position, style, navigate, }: TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const TabBarBaseComponent: ({ children, navigationState, position, style, navigate, screenOptions, }: TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
//# sourceMappingURL=TabBarBaseComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarBaseComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/elements/TabBarBaseComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAmB,
|
|
1
|
+
{"version":3,"file":"TabBarBaseComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/elements/TabBarBaseComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAmB,EAKjB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGxE,MAAM,WAAW,WAAY,SAAQ,sBAAsB,CAAC,gBAAgB;IAC1E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB,6EAO7B,WAAW,4CA4Eb,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
3
|
+
import { type ReanimatedTabViewTypes } from '../ReanimatedTopTab/types';
|
|
4
|
+
interface TabBarBaseItemProps {
|
|
5
|
+
position: SharedValue<number>;
|
|
6
|
+
index: number;
|
|
7
|
+
inputRange: Array<number>;
|
|
8
|
+
onPress: (index: number) => void;
|
|
9
|
+
route: ReanimatedTabViewTypes.Route;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
export declare const TabBarBaseItem: ({ position, index, inputRange, onPress, route, style, }: TabBarBaseItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=TabBarBaseItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabBarBaseItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/elements/TabBarBaseItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAiB,EACf,KAAK,WAAW,EAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,eAAO,MAAM,cAAc,4DAOxB,mBAAmB,4CAoCrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GestureWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/wrappers/GestureWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GestureWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/wrappers/GestureWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAgBzD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,iBAAkB,mBAAmB,4CAgH/D,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type DefaultSectionT, type SectionListProps } from 'react-native';
|
|
2
|
+
export declare const SectionList: <ItemT, SectionT = DefaultSectionT>({ children, style, contentContainerStyle, onLayout, ...props }: SectionListProps<ItemT, SectionT>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=SectionList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionList.d.ts","sourceRoot":"","sources":["../../../../../src/components/wrappers/SectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EAGtB,MAAM,cAAc,CAAC;AAUtB,eAAO,MAAM,WAAW,GAAI,KAAK,EAAE,QAAQ,oFAMxC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,4CA2CnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.hooks.d.ts","sourceRoot":"","sources":["../../../../src/context/Context.hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Context.hooks.d.ts","sourceRoot":"","sources":["../../../../src/context/Context.hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAkTlC,eAAO,MAAM,YAAY;6FA3RtB,IAAI,CACL,0BAA0B,CAAC,WAAW,EACtC,SAAS,GAAG,kBAAkB,GAAG,iBAAiB,CACnD;oCAqJE;QACD,KAAK,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;KAC1C,KAAG,0BAA0B,CAAC,kBAAkB,CAAC,SAAS,CAAC;iDAuBzD,IAAI,CAAC,0BAA0B,CAAC,WAAW,EAAE,QAAQ,CAAC;;;;;;;gGA8EtD,IAAI,CACL,0BAA0B,CAAC,WAAW,EACtC,QAAQ,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,gBAAgB,CACvE;CA8BA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeader.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useHeader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHeader.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useHeader.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;CAQrB,CAAC"}
|
|
@@ -4,7 +4,7 @@ export declare const useScreenProperties: () => {
|
|
|
4
4
|
outerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
5
5
|
scrollY: import("react-native-reanimated").SharedValue<number>;
|
|
6
6
|
scrollRef: {
|
|
7
|
-
current: import("react-native-reanimated/lib/typescript/Animated").ScrollView | null;
|
|
7
|
+
current: import("react-native-reanimated/lib/typescript/Animated").ScrollView | import("react-native").SectionList | null;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=useScreenProperties.d.ts.map
|
|
@@ -3,12 +3,6 @@ export { createReanimatedTopTabNavigator } from './navigator/createReanimatedTop
|
|
|
3
3
|
export declare const TabHooks: {
|
|
4
4
|
useHeader: () => {
|
|
5
5
|
hideHeader: () => void;
|
|
6
|
-
defaultStyle: {
|
|
7
|
-
transform: {
|
|
8
|
-
translateY: number;
|
|
9
|
-
}[];
|
|
10
|
-
zIndex: number;
|
|
11
|
-
};
|
|
12
6
|
};
|
|
13
7
|
useScreenProperties: () => {
|
|
14
8
|
innerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
@@ -16,7 +10,7 @@ export declare const TabHooks: {
|
|
|
16
10
|
outerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
17
11
|
scrollY: import("react-native-reanimated").SharedValue<number>;
|
|
18
12
|
scrollRef: {
|
|
19
|
-
current: import("react-native-reanimated/lib/typescript/Animated").ScrollView | null;
|
|
13
|
+
current: import("react-native-reanimated/lib/typescript/Animated").ScrollView | import("react-native").SectionList | null;
|
|
20
14
|
};
|
|
21
15
|
};
|
|
22
16
|
useScreenScrollable: () => {
|
|
@@ -39,8 +33,9 @@ export declare const TabHooks: {
|
|
|
39
33
|
};
|
|
40
34
|
export declare const Tab: {
|
|
41
35
|
ScrollView: ({ children, style, contentContainerStyle, onLayout, ...props }: import("./components/wrappers/ScrollView").ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
SectionList: <ItemT, SectionT = import("react-native").DefaultSectionT>({ children, style, contentContainerStyle, onLayout, ...props }: import("react-native").SectionListProps<ItemT, SectionT>) => import("react/jsx-runtime").JSX.Element;
|
|
42
37
|
ScreenWrapper: ({ children, ...viewProps }: import("./components/wrappers/ScreenWrapper").ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
TabBarBaseComponent: ({ children, navigationState, position, style, navigate, }: import("./components/elements/TabBarBaseComponent").TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
TabBarBaseComponent: ({ children, navigationState, position, style, navigate, screenOptions, }: import("./components/elements/TabBarBaseComponent").TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
39
|
TabBarLabelBaseComponent: ({ index, ...props }: import("./components/elements/TabBarLabelBaseComponent").TabBarLabelTypes) => import("react/jsx-runtime").JSX.Element;
|
|
45
40
|
};
|
|
46
41
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAU9F,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOpB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;;;CAMf,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ParamListBase, type TabNavigationState } from '@react-navigation/native';
|
|
2
2
|
import { type ReanimatedTopTabNavigation } from '../types';
|
|
3
|
-
export declare const createReanimatedTopTabNavigator: <Params extends ParamListBase>() => import("@react-navigation/core").TypedNavigator<ParamListBase, TabNavigationState<Params>, ReanimatedTopTabNavigation.NavigationOptions, {}, ({ HeaderComponent, TabBarComponent, children, config, initialRouteName, screenOptions, }: ReanimatedTopTabNavigation.TabViewNavigatorProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export declare const createReanimatedTopTabNavigator: <Params extends ParamListBase>() => import("@react-navigation/core").TypedNavigator<ParamListBase, TabNavigationState<Params>, ReanimatedTopTabNavigation.NavigationOptions, {}, ({ HeaderComponent, TopComponent, TabBarComponent, children, config, initialRouteName, screenOptions, }: ReanimatedTopTabNavigation.TabViewNavigatorProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
4
|
//# sourceMappingURL=createReanimatedTopTabNavigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createReanimatedTopTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigator/createReanimatedTopTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,kBAAkB,EAGxB,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"createReanimatedTopTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigator/createReanimatedTopTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,kBAAkB,EAGxB,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,UAAU,CAAC;AA+G3D,eAAO,MAAM,+BAA+B,GAC1C,MAAM,SAAS,aAAa,6PAhG3B,0BAA0B,CAAC,qBAAqB,6CAuG5B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TabBarBaseComponent } from './components/elements/TabBarBaseComponent';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { type ReactNode } from 'react';
|
|
4
|
-
import { type LayoutRectangle } from 'react-native';
|
|
4
|
+
import { SectionList, type LayoutRectangle, type StyleProp, type ViewStyle } from 'react-native';
|
|
5
5
|
import { type NativeGesture } from 'react-native-gesture-handler';
|
|
6
6
|
import Reanimated, { type SharedValue } from 'react-native-reanimated';
|
|
7
7
|
import { type StackNavigationOptions } from '@react-navigation/stack';
|
|
@@ -27,12 +27,12 @@ export declare namespace ReanimatedTopTabNavigation {
|
|
|
27
27
|
outerLayout: SharedValue<LayoutRectangle>;
|
|
28
28
|
scrollY: SharedValue<number>;
|
|
29
29
|
scrollRef: {
|
|
30
|
-
current: Reanimated.ScrollView | null;
|
|
30
|
+
current: Reanimated.ScrollView | SectionList | null;
|
|
31
31
|
};
|
|
32
32
|
}>;
|
|
33
|
-
setRef(key: string, ref: Reanimated.ScrollView | null): void;
|
|
33
|
+
setRef(key: string, ref: Reanimated.ScrollView | SectionList | null): void;
|
|
34
34
|
getRef(key: string): {
|
|
35
|
-
current: Reanimated.ScrollView | null;
|
|
35
|
+
current: Reanimated.ScrollView | SectionList | null;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
route: {
|
|
@@ -43,6 +43,7 @@ export declare namespace ReanimatedTopTabNavigation {
|
|
|
43
43
|
}
|
|
44
44
|
interface TabViewNavigatorProps {
|
|
45
45
|
HeaderComponent?: React.ComponentType<Pick<ContextType, 'transformationY' | 'headerHeight'>>;
|
|
46
|
+
TopComponent?: React.ComponentType<Pick<ContextType, 'transformationY'>>;
|
|
46
47
|
TabBarComponent?: typeof TabBarBaseComponent;
|
|
47
48
|
children: ReactNode;
|
|
48
49
|
config?: string[];
|
|
@@ -59,6 +60,9 @@ export declare namespace ReanimatedTopTabNavigation {
|
|
|
59
60
|
title: string;
|
|
60
61
|
}) => React.ReactNode;
|
|
61
62
|
title?: string;
|
|
63
|
+
tabBarIndicatorStyle?: StyleProp<ViewStyle>;
|
|
64
|
+
tabBarItemStyle?: StyleProp<ViewStyle>;
|
|
65
|
+
tabBarStyle?: StyleProp<ViewStyle>;
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
PanGestureChangeEventPayload,
|
|
5
5
|
PanGestureHandlerEventPayload,
|
|
6
6
|
} from 'react-native-gesture-handler';
|
|
7
|
-
import { withTiming
|
|
7
|
+
import { withTiming } from 'react-native-reanimated';
|
|
8
8
|
|
|
9
9
|
type NavigationState = { size: number; index: number };
|
|
10
10
|
|
|
@@ -83,9 +83,9 @@ const onEnd = (
|
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
const animation = (newValue: number, duration =
|
|
86
|
+
const animation = (newValue: number, duration = 350) => {
|
|
87
87
|
'worklet';
|
|
88
|
-
return
|
|
88
|
+
return withTiming(newValue, { duration });
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
export const AnimationHelper = {
|
|
@@ -15,6 +15,7 @@ import Reanimated, {
|
|
|
15
15
|
useDerivedValue,
|
|
16
16
|
useSharedValue,
|
|
17
17
|
} from 'react-native-reanimated';
|
|
18
|
+
import type { ReanimatedTopTabNavigation } from 'react-navigation-reanimated-top-tabs';
|
|
18
19
|
import { AnimationHelper } from './AnimationHelper';
|
|
19
20
|
import type { ReanimatedTabViewTypes } from './types';
|
|
20
21
|
|
|
@@ -29,6 +30,7 @@ export interface ReanimatedTabViewProps {
|
|
|
29
30
|
params: ReanimatedTabViewTypes.RenderTabsParams
|
|
30
31
|
) => React.ReactNode;
|
|
31
32
|
navigate(index: number): void;
|
|
33
|
+
screenOptions?: ReanimatedTopTabNavigation.NavigationOptions;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export const ReanimatedTabView = React.memo<ReanimatedTabViewProps>(
|
|
@@ -41,6 +43,7 @@ export const ReanimatedTabView = React.memo<ReanimatedTabViewProps>(
|
|
|
41
43
|
renderScene,
|
|
42
44
|
renderTabBar,
|
|
43
45
|
navigate,
|
|
46
|
+
screenOptions,
|
|
44
47
|
}) => {
|
|
45
48
|
const { width } = useWindowDimensions();
|
|
46
49
|
const loadedScreens = useRef([
|
|
@@ -178,6 +181,7 @@ export const ReanimatedTabView = React.memo<ReanimatedTabViewProps>(
|
|
|
178
181
|
navigationState,
|
|
179
182
|
position,
|
|
180
183
|
navigate: _navigate,
|
|
184
|
+
screenOptions,
|
|
181
185
|
})
|
|
182
186
|
: null}
|
|
183
187
|
<GestureDetector gesture={panGesture}>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SharedValue } from 'react-native-reanimated';
|
|
3
|
+
import type { ReanimatedTopTabNavigation } from 'react-navigation-reanimated-top-tabs';
|
|
3
4
|
|
|
4
5
|
export namespace ReanimatedTabViewTypes {
|
|
5
6
|
export interface Route {
|
|
6
7
|
key: string;
|
|
7
8
|
name: string;
|
|
8
|
-
tabBarLabel?: () => React.ReactNode;
|
|
9
|
+
tabBarLabel?: (focused: boolean) => React.ReactNode;
|
|
9
10
|
title?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -15,6 +16,7 @@ export namespace ReanimatedTabViewTypes {
|
|
|
15
16
|
navigationState: NavigationState;
|
|
16
17
|
position: SharedValue<number>;
|
|
17
18
|
navigate(index: number): void;
|
|
19
|
+
screenOptions?: ReanimatedTopTabNavigation.NavigationOptions;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export interface SceneProps {
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet, useWindowDimensions } from 'react-native';
|
|
3
3
|
import Reanimated, {
|
|
4
|
-
type AnimatedStyle,
|
|
5
4
|
interpolate,
|
|
6
5
|
useAnimatedReaction,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
useSharedValue,
|
|
8
|
+
type AnimatedStyle,
|
|
7
9
|
} from 'react-native-reanimated';
|
|
8
10
|
|
|
9
11
|
import { useTabContext } from '../../hooks/useTabContext';
|
|
10
12
|
import { type ReanimatedTabViewTypes } from '../ReanimatedTopTab/types';
|
|
13
|
+
import { TabBarBaseItem } from './TabBarBaseItem';
|
|
11
14
|
|
|
12
15
|
export interface TabBarProps extends ReanimatedTabViewTypes.RenderTabsParams {
|
|
13
16
|
children?: React.ReactNode;
|
|
@@ -20,10 +23,35 @@ export const TabBarBaseComponent = ({
|
|
|
20
23
|
position,
|
|
21
24
|
style,
|
|
22
25
|
navigate,
|
|
26
|
+
screenOptions,
|
|
23
27
|
}: TabBarProps) => {
|
|
24
28
|
const layout = useWindowDimensions();
|
|
25
|
-
|
|
26
29
|
const { topTabHeight, transformationX } = useTabContext();
|
|
30
|
+
const width = useSharedValue(0);
|
|
31
|
+
|
|
32
|
+
const { tabBarIndicatorStyle, tabBarItemStyle, tabBarStyle } =
|
|
33
|
+
screenOptions ?? {};
|
|
34
|
+
|
|
35
|
+
const inputRange = navigationState.routes.map((_, index) => index);
|
|
36
|
+
|
|
37
|
+
const indicatorStyle = useAnimatedStyle(() => {
|
|
38
|
+
const outputRange = navigationState.routes.map(
|
|
39
|
+
(_, index) => index * (width.value / navigationState.routes.length)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
transform: [
|
|
44
|
+
{
|
|
45
|
+
translateX: interpolate(
|
|
46
|
+
transformationX.value,
|
|
47
|
+
inputRange,
|
|
48
|
+
outputRange
|
|
49
|
+
),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
width: width.value / navigationState.routes.length,
|
|
53
|
+
};
|
|
54
|
+
});
|
|
27
55
|
|
|
28
56
|
//Assign interpolated offsetX to transformationX
|
|
29
57
|
useAnimatedReaction(
|
|
@@ -46,21 +74,27 @@ export const TabBarBaseComponent = ({
|
|
|
46
74
|
topTabHeight.value = nativeEvent.layout.height;
|
|
47
75
|
}}
|
|
48
76
|
>
|
|
49
|
-
<Reanimated.View
|
|
77
|
+
<Reanimated.View
|
|
78
|
+
onLayout={({ nativeEvent }) => {
|
|
79
|
+
width.value = nativeEvent.layout.width;
|
|
80
|
+
}}
|
|
81
|
+
style={[styles.wrapper, tabBarStyle, style]}
|
|
82
|
+
>
|
|
83
|
+
<Reanimated.View
|
|
84
|
+
style={[styles.indicator, indicatorStyle, tabBarIndicatorStyle]}
|
|
85
|
+
/>
|
|
50
86
|
{navigationState.routes.map((route, index) => (
|
|
51
|
-
<
|
|
52
|
-
|
|
87
|
+
<TabBarBaseItem
|
|
88
|
+
index={index}
|
|
89
|
+
inputRange={inputRange}
|
|
90
|
+
position={transformationX}
|
|
53
91
|
key={route.key}
|
|
54
92
|
onPress={() => {
|
|
55
93
|
navigate(index);
|
|
56
94
|
}}
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
) : (
|
|
61
|
-
<Text style={styles.label}>{route.title}</Text>
|
|
62
|
-
)}
|
|
63
|
-
</Pressable>
|
|
95
|
+
route={route}
|
|
96
|
+
style={tabBarItemStyle}
|
|
97
|
+
/>
|
|
64
98
|
))}
|
|
65
99
|
</Reanimated.View>
|
|
66
100
|
{children}
|
|
@@ -75,14 +109,14 @@ const styles = StyleSheet.create({
|
|
|
75
109
|
alignItems: 'center',
|
|
76
110
|
justifyContent: 'center',
|
|
77
111
|
},
|
|
78
|
-
label: {
|
|
79
|
-
color: 'red',
|
|
80
|
-
},
|
|
81
112
|
wrapper: {
|
|
82
|
-
width: '100%',
|
|
83
113
|
flexDirection: 'row',
|
|
84
114
|
backgroundColor: 'white',
|
|
85
|
-
|
|
86
|
-
|
|
115
|
+
},
|
|
116
|
+
indicator: {
|
|
117
|
+
backgroundColor: 'black',
|
|
118
|
+
bottom: 0,
|
|
119
|
+
height: 2,
|
|
120
|
+
position: 'absolute',
|
|
87
121
|
},
|
|
88
122
|
});
|