@r0b0t3d/react-native-collapsible 1.0.1 → 1.2.0-alpha.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/CollapsibleContainer.js +4 -2
- package/lib/commonjs/components/CollapsibleContainer.js.map +1 -1
- package/lib/commonjs/components/CollapsibleView.js +4 -3
- package/lib/commonjs/components/CollapsibleView.js.map +1 -1
- package/lib/commonjs/components/{AnimatedTopView.js → header/AnimatedTopView.js} +0 -0
- package/lib/commonjs/components/{AnimatedTopView.js.map → header/AnimatedTopView.js.map} +0 -0
- package/lib/commonjs/components/{CollapsibleHeaderContainer.js → header/CollapsibleHeaderContainer.js} +9 -8
- package/lib/commonjs/components/header/CollapsibleHeaderContainer.js.map +1 -0
- package/lib/commonjs/components/{StickyView.js → header/StickyView.js} +18 -31
- package/lib/commonjs/components/header/StickyView.js.map +1 -0
- package/lib/commonjs/components/pullToRefresh/PullToRefreshContainer.js +75 -0
- package/lib/commonjs/components/pullToRefresh/PullToRefreshContainer.js.map +1 -0
- package/lib/commonjs/components/pullToRefresh/PullToRefreshProvider.js +35 -0
- package/lib/commonjs/components/pullToRefresh/PullToRefreshProvider.js.map +1 -0
- package/lib/commonjs/components/pullToRefresh/RefreshControl.js +73 -0
- package/lib/commonjs/components/pullToRefresh/RefreshControl.js.map +1 -0
- package/lib/commonjs/components/pullToRefresh/usePullToRefreshContext.js +24 -0
- package/lib/commonjs/components/pullToRefresh/usePullToRefreshContext.js.map +1 -0
- package/lib/commonjs/components/pullToRefresh/utils.js +59 -0
- package/lib/commonjs/components/pullToRefresh/utils.js.map +1 -0
- package/lib/commonjs/components/{CollapsibleFlatList.js → scrollable/CollapsibleFlatList.js} +36 -31
- package/lib/commonjs/components/scrollable/CollapsibleFlatList.js.map +1 -0
- package/lib/commonjs/components/{CollapsibleScrollView.js → scrollable/CollapsibleScrollView.js} +6 -6
- package/lib/commonjs/components/scrollable/CollapsibleScrollView.js.map +1 -0
- package/lib/commonjs/{hooks → components/scrollable}/useAnimatedScroll.js +7 -7
- package/lib/commonjs/components/scrollable/useAnimatedScroll.js.map +1 -0
- package/lib/commonjs/hooks/useInternalCollapsibleContext.js +1 -1
- package/lib/commonjs/hooks/useInternalCollapsibleContext.js.map +1 -1
- package/lib/commonjs/index.js +21 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/{types.js → types.d.js} +1 -1
- package/lib/commonjs/{types.js.map → types.d.js.map} +0 -0
- package/lib/commonjs/utils/debounce.js +20 -0
- package/lib/commonjs/utils/debounce.js.map +1 -0
- package/lib/commonjs/{hooks/withCollapsibleContext.js → withCollapsibleContext.js} +95 -64
- package/lib/commonjs/withCollapsibleContext.js.map +1 -0
- package/lib/module/components/CollapsibleContainer.js +1 -1
- package/lib/module/components/CollapsibleContainer.js.map +1 -1
- package/lib/module/components/CollapsibleView.js +4 -3
- package/lib/module/components/CollapsibleView.js.map +1 -1
- package/lib/module/components/{AnimatedTopView.js → header/AnimatedTopView.js} +0 -0
- package/lib/module/components/{AnimatedTopView.js.map → header/AnimatedTopView.js.map} +0 -0
- package/lib/module/components/{CollapsibleHeaderContainer.js → header/CollapsibleHeaderContainer.js} +7 -6
- package/lib/module/components/header/CollapsibleHeaderContainer.js.map +1 -0
- package/lib/module/components/{StickyView.js → header/StickyView.js} +17 -30
- package/lib/module/components/header/StickyView.js.map +1 -0
- package/lib/module/components/pullToRefresh/PullToRefreshContainer.js +56 -0
- package/lib/module/components/pullToRefresh/PullToRefreshContainer.js.map +1 -0
- package/lib/module/components/pullToRefresh/PullToRefreshProvider.js +21 -0
- package/lib/module/components/pullToRefresh/PullToRefreshProvider.js.map +1 -0
- package/lib/module/components/pullToRefresh/RefreshControl.js +55 -0
- package/lib/module/components/pullToRefresh/RefreshControl.js.map +1 -0
- package/lib/module/components/pullToRefresh/usePullToRefreshContext.js +13 -0
- package/lib/module/components/pullToRefresh/usePullToRefreshContext.js.map +1 -0
- package/lib/module/components/pullToRefresh/utils.js +42 -0
- package/lib/module/components/pullToRefresh/utils.js.map +1 -0
- package/lib/module/components/{CollapsibleFlatList.js → scrollable/CollapsibleFlatList.js} +36 -32
- package/lib/module/components/scrollable/CollapsibleFlatList.js.map +1 -0
- package/lib/module/components/{CollapsibleScrollView.js → scrollable/CollapsibleScrollView.js} +5 -5
- package/lib/module/components/scrollable/CollapsibleScrollView.js.map +1 -0
- package/lib/module/{hooks → components/scrollable}/useAnimatedScroll.js +6 -6
- package/lib/module/components/scrollable/useAnimatedScroll.js.map +1 -0
- package/lib/module/hooks/useInternalCollapsibleContext.js +1 -1
- package/lib/module/hooks/useInternalCollapsibleContext.js.map +1 -1
- package/lib/module/index.js +6 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.d.js +2 -0
- package/lib/module/{types.js.map → types.d.js.map} +0 -0
- package/lib/module/utils/debounce.js +13 -0
- package/lib/module/utils/debounce.js.map +1 -0
- package/lib/module/withCollapsibleContext.js +163 -0
- package/lib/module/withCollapsibleContext.js.map +1 -0
- package/lib/typescript/components/CollapsibleView.d.ts +1 -1
- package/lib/typescript/components/{AnimatedTopView.d.ts → header/AnimatedTopView.d.ts} +0 -0
- package/lib/typescript/components/{CollapsibleHeaderContainer.d.ts → header/CollapsibleHeaderContainer.d.ts} +0 -0
- package/lib/typescript/components/{StickyView.d.ts → header/StickyView.d.ts} +0 -0
- package/lib/typescript/components/pullToRefresh/PullToRefreshContainer.d.ts +8 -0
- package/lib/typescript/components/pullToRefresh/PullToRefreshProvider.d.ts +6 -0
- package/lib/typescript/components/pullToRefresh/RefreshControl.d.ts +9 -0
- package/lib/typescript/components/pullToRefresh/usePullToRefreshContext.d.ts +4 -0
- package/lib/typescript/components/pullToRefresh/utils.d.ts +20 -0
- package/lib/typescript/components/{CollapsibleFlatList.d.ts → scrollable/CollapsibleFlatList.d.ts} +1 -1
- package/lib/typescript/components/{CollapsibleScrollView.d.ts → scrollable/CollapsibleScrollView.d.ts} +1 -1
- package/lib/typescript/{hooks → components/scrollable}/useAnimatedScroll.d.ts +0 -0
- package/lib/typescript/hooks/useInternalCollapsibleContext.d.ts +1 -1
- package/lib/typescript/index.d.ts +6 -5
- package/lib/typescript/utils/debounce.d.ts +1 -0
- package/lib/typescript/{hooks/withCollapsibleContext.d.ts → withCollapsibleContext.d.ts} +0 -0
- package/package.json +4 -2
- package/src/components/CollapsibleContainer.tsx +1 -1
- package/src/components/CollapsibleView.tsx +4 -3
- package/src/components/{AnimatedTopView.tsx → header/AnimatedTopView.tsx} +0 -0
- package/src/components/{CollapsibleHeaderContainer.tsx → header/CollapsibleHeaderContainer.tsx} +6 -4
- package/src/components/{StickyView.tsx → header/StickyView.tsx} +15 -22
- package/src/components/pullToRefresh/PullToRefreshContainer.tsx +65 -0
- package/src/components/pullToRefresh/PullToRefreshProvider.tsx +27 -0
- package/src/components/pullToRefresh/RefreshControl.tsx +80 -0
- package/src/components/pullToRefresh/usePullToRefreshContext.ts +13 -0
- package/src/components/pullToRefresh/utils.ts +49 -0
- package/src/components/scrollable/CollapsibleFlatList.tsx +135 -0
- package/src/components/{CollapsibleScrollView.tsx → scrollable/CollapsibleScrollView.tsx} +6 -6
- package/src/{hooks → components/scrollable}/useAnimatedScroll.ts +8 -8
- package/src/hooks/useInternalCollapsibleContext.ts +1 -1
- package/src/index.tsx +6 -5
- package/src/{types.ts → types.d.ts} +14 -3
- package/src/utils/debounce.ts +10 -0
- package/src/withCollapsibleContext.tsx +201 -0
- package/lib/commonjs/components/CollapsibleFlatList.js.map +0 -1
- package/lib/commonjs/components/CollapsibleHeaderContainer.js.map +0 -1
- package/lib/commonjs/components/CollapsibleScrollView.js.map +0 -1
- package/lib/commonjs/components/StickyView.js.map +0 -1
- package/lib/commonjs/hooks/useAnimatedScroll.js.map +0 -1
- package/lib/commonjs/hooks/withCollapsibleContext.js.map +0 -1
- package/lib/module/components/CollapsibleFlatList.js.map +0 -1
- package/lib/module/components/CollapsibleHeaderContainer.js.map +0 -1
- package/lib/module/components/CollapsibleScrollView.js.map +0 -1
- package/lib/module/components/StickyView.js.map +0 -1
- package/lib/module/hooks/useAnimatedScroll.js.map +0 -1
- package/lib/module/hooks/withCollapsibleContext.js +0 -136
- package/lib/module/hooks/withCollapsibleContext.js.map +0 -1
- package/lib/module/types.js +0 -2
- package/lib/typescript/types.d.ts +0 -33
- package/src/components/CollapsibleFlatList.tsx +0 -119
- package/src/hooks/withCollapsibleContext.tsx +0 -164
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useCallback,
|
|
3
|
-
useEffect,
|
|
4
|
-
useMemo,
|
|
5
|
-
useRef,
|
|
6
|
-
useState,
|
|
7
|
-
} from 'react';
|
|
8
|
-
import { FlatListProps, FlatList, View, StyleSheet } from 'react-native';
|
|
9
|
-
import Animated, { runOnJS, useDerivedValue } from 'react-native-reanimated';
|
|
10
|
-
import AnimatedTopView from './AnimatedTopView';
|
|
11
|
-
import useAnimatedScroll from '../hooks/useAnimatedScroll';
|
|
12
|
-
import useCollapsibleContext from '../hooks/useCollapsibleContext';
|
|
13
|
-
import type { CollapsibleProps } from '../types';
|
|
14
|
-
import { useInternalCollapsibleContext } from '../hooks/useInternalCollapsibleContext';
|
|
15
|
-
|
|
16
|
-
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
|
|
17
|
-
|
|
18
|
-
type Props<Data> = Omit<FlatListProps<Data>, 'scrollEnabled'> &
|
|
19
|
-
CollapsibleProps;
|
|
20
|
-
|
|
21
|
-
export default function CollapsibleFlatList<Data>({
|
|
22
|
-
headerSnappable = true,
|
|
23
|
-
...props
|
|
24
|
-
}: Props<Data>) {
|
|
25
|
-
const scrollView = useRef<FlatList>(null);
|
|
26
|
-
const { headerHeight } = useCollapsibleContext();
|
|
27
|
-
const { contentMinHeight } = useInternalCollapsibleContext();
|
|
28
|
-
const mounted = useRef(true);
|
|
29
|
-
const contentHeight = useRef(0);
|
|
30
|
-
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
return () => {
|
|
33
|
-
mounted.current = false;
|
|
34
|
-
};
|
|
35
|
-
}, []);
|
|
36
|
-
|
|
37
|
-
const scrollTo = useCallback((yValue: number, animated = true) => {
|
|
38
|
-
scrollView.current?.scrollToOffset({
|
|
39
|
-
offset: yValue,
|
|
40
|
-
animated,
|
|
41
|
-
});
|
|
42
|
-
}, []);
|
|
43
|
-
|
|
44
|
-
const handleInternalContentHeight = useCallback((value: number) => {
|
|
45
|
-
if (mounted.current) {
|
|
46
|
-
setInternalContentMinHeight(value);
|
|
47
|
-
}
|
|
48
|
-
}, []);
|
|
49
|
-
|
|
50
|
-
const { scrollHandler } = useAnimatedScroll({
|
|
51
|
-
headerSnappable,
|
|
52
|
-
scrollTo,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const [internalContentMinHeight, setInternalContentMinHeight] = useState(
|
|
56
|
-
contentMinHeight.value
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
useDerivedValue(() => {
|
|
60
|
-
if (
|
|
61
|
-
contentHeight.current < contentMinHeight.value &&
|
|
62
|
-
contentMinHeight.value !== internalContentMinHeight
|
|
63
|
-
) {
|
|
64
|
-
runOnJS(handleInternalContentHeight)(contentMinHeight.value);
|
|
65
|
-
}
|
|
66
|
-
}, [internalContentMinHeight, contentHeight.current]);
|
|
67
|
-
|
|
68
|
-
const contentContainerStyle = useMemo(
|
|
69
|
-
() => [
|
|
70
|
-
styles.contentContainer,
|
|
71
|
-
{ minHeight: internalContentMinHeight },
|
|
72
|
-
props.contentContainerStyle,
|
|
73
|
-
],
|
|
74
|
-
[props.contentContainerStyle, internalContentMinHeight]
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
const handleContentSizeChange = useCallback((_, height) => {
|
|
78
|
-
contentHeight.current = height;
|
|
79
|
-
}, []);
|
|
80
|
-
|
|
81
|
-
const renderListHeader = () => (
|
|
82
|
-
<View>
|
|
83
|
-
<AnimatedTopView height={headerHeight} />
|
|
84
|
-
{props.ListHeaderComponent}
|
|
85
|
-
</View>
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
// @ts-ignore
|
|
90
|
-
<AnimatedFlatList
|
|
91
|
-
ref={scrollView}
|
|
92
|
-
bounces={false}
|
|
93
|
-
keyboardDismissMode="on-drag"
|
|
94
|
-
keyboardShouldPersistTaps="handled"
|
|
95
|
-
scrollEventThrottle={16}
|
|
96
|
-
{...props}
|
|
97
|
-
style={[styles.container, props.style]}
|
|
98
|
-
contentContainerStyle={contentContainerStyle}
|
|
99
|
-
onScroll={scrollHandler}
|
|
100
|
-
ListHeaderComponent={renderListHeader()}
|
|
101
|
-
onContentSizeChange={handleContentSizeChange}
|
|
102
|
-
/>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const styles = StyleSheet.create({
|
|
107
|
-
container: {
|
|
108
|
-
...StyleSheet.absoluteFillObject,
|
|
109
|
-
},
|
|
110
|
-
contentContainer: {
|
|
111
|
-
flexGrow: 1,
|
|
112
|
-
},
|
|
113
|
-
topView: {
|
|
114
|
-
position: 'absolute',
|
|
115
|
-
top: 0,
|
|
116
|
-
left: 0,
|
|
117
|
-
right: 0,
|
|
118
|
-
},
|
|
119
|
-
});
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
|
-
import React, { FC, useCallback, useMemo, useRef } from 'react';
|
|
3
|
-
import type { CollapsibleHandles, LayoutParams } from '../types';
|
|
4
|
-
import { CollapsibleContext } from './useCollapsibleContext';
|
|
5
|
-
import { InternalCollapsibleContext } from './useInternalCollapsibleContext';
|
|
6
|
-
import { useSharedValue, withTiming } from 'react-native-reanimated';
|
|
7
|
-
import type { View } from 'react-native';
|
|
8
|
-
|
|
9
|
-
export default function withCollapsibleContext<T>(Component: FC<T>) {
|
|
10
|
-
return (props: T) => {
|
|
11
|
-
const collapsibleHandlers = useRef<CollapsibleHandles>();
|
|
12
|
-
const headerHeight = useSharedValue(0);
|
|
13
|
-
const scrollY = useSharedValue(0);
|
|
14
|
-
const headerCollapsed = useSharedValue(false);
|
|
15
|
-
const contentMinHeight = useSharedValue(0);
|
|
16
|
-
const stickyViewTops = useSharedValue<Record<string, number>>({});
|
|
17
|
-
const stickyHeaderHeight = useRef(0);
|
|
18
|
-
const containerHeight = useRef(0);
|
|
19
|
-
const firstStickyViewY = useRef(1000000);
|
|
20
|
-
const fixedHeaderHeight = useRef(0);
|
|
21
|
-
const headerContainersHeight = useRef<Record<string, number>>({});
|
|
22
|
-
const stickyViewPositions = useRef<Record<string, LayoutParams>>({});
|
|
23
|
-
const containerRef = useRef<View>(null);
|
|
24
|
-
|
|
25
|
-
const setCollapsibleHandlers = useCallback((handlers) => {
|
|
26
|
-
collapsibleHandlers.current = handlers;
|
|
27
|
-
}, []);
|
|
28
|
-
|
|
29
|
-
const refreshHeaderCollapsed = useCallback(() => {
|
|
30
|
-
const maxY = fixedHeaderHeight.current - firstStickyViewY.current;
|
|
31
|
-
const isCollapsed = scrollY.value >= maxY;
|
|
32
|
-
headerCollapsed.value = isCollapsed;
|
|
33
|
-
}, []);
|
|
34
|
-
|
|
35
|
-
const refreshMinContentHeight = useCallback(() => {
|
|
36
|
-
contentMinHeight.value =
|
|
37
|
-
containerHeight.current +
|
|
38
|
-
fixedHeaderHeight.current -
|
|
39
|
-
stickyHeaderHeight.current;
|
|
40
|
-
}, []);
|
|
41
|
-
|
|
42
|
-
const populateData = useCallback(() => {
|
|
43
|
-
const viewPositions = stickyViewPositions.current;
|
|
44
|
-
const headerHeight = fixedHeaderHeight.current;
|
|
45
|
-
|
|
46
|
-
const sortedKeys = Object.keys(viewPositions).sort(
|
|
47
|
-
(a, b) => viewPositions[a].top - viewPositions[b].top
|
|
48
|
-
);
|
|
49
|
-
let totalTop = 0;
|
|
50
|
-
const values: any = {};
|
|
51
|
-
for (let i = 0; i < sortedKeys.length; i++) {
|
|
52
|
-
values[sortedKeys[i]] = totalTop;
|
|
53
|
-
// Try minus 1 make it filled when scrolling up.
|
|
54
|
-
// Otherwise, we can see a small space between the persits views
|
|
55
|
-
totalTop += viewPositions[sortedKeys[i]].height - 1;
|
|
56
|
-
}
|
|
57
|
-
stickyViewTops.value = values;
|
|
58
|
-
firstStickyViewY.current = viewPositions[sortedKeys[0]]?.top || 0;
|
|
59
|
-
refreshHeaderCollapsed();
|
|
60
|
-
const stickyHeader = sortedKeys.reduce((acc, key) => {
|
|
61
|
-
const data = viewPositions[key];
|
|
62
|
-
const isInsideHeader = data.top < headerHeight;
|
|
63
|
-
if (isInsideHeader) {
|
|
64
|
-
return acc + data.height;
|
|
65
|
-
}
|
|
66
|
-
return acc;
|
|
67
|
-
}, 0);
|
|
68
|
-
stickyHeaderHeight.current = stickyHeader;
|
|
69
|
-
refreshMinContentHeight();
|
|
70
|
-
}, [stickyViewPositions.current, fixedHeaderHeight.current]);
|
|
71
|
-
|
|
72
|
-
const handleStickyViewLayout = useCallback(
|
|
73
|
-
(viewKey: string, layout?: LayoutParams) => {
|
|
74
|
-
if (!layout) {
|
|
75
|
-
delete stickyViewPositions.current[viewKey];
|
|
76
|
-
} else {
|
|
77
|
-
stickyViewPositions.current = {
|
|
78
|
-
...stickyViewPositions.current,
|
|
79
|
-
[viewKey]: layout,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
populateData();
|
|
83
|
-
},
|
|
84
|
-
[populateData, fixedHeaderHeight]
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const handleHeaderContainerLayout = useCallback(
|
|
88
|
-
(viewKey: string, height?: number) => {
|
|
89
|
-
if (!height) {
|
|
90
|
-
delete headerContainersHeight.current[viewKey];
|
|
91
|
-
} else {
|
|
92
|
-
headerContainersHeight.current[viewKey] = height;
|
|
93
|
-
}
|
|
94
|
-
const totalHeight = Object.keys(headerContainersHeight.current).reduce(
|
|
95
|
-
(acc, key) => headerContainersHeight.current[key] + acc,
|
|
96
|
-
0
|
|
97
|
-
);
|
|
98
|
-
headerHeight.value = withTiming(totalHeight, {
|
|
99
|
-
duration: fixedHeaderHeight.current === 0 ? 0 : 200,
|
|
100
|
-
});
|
|
101
|
-
fixedHeaderHeight.current = totalHeight;
|
|
102
|
-
|
|
103
|
-
populateData();
|
|
104
|
-
refreshHeaderCollapsed();
|
|
105
|
-
refreshMinContentHeight();
|
|
106
|
-
},
|
|
107
|
-
[populateData, refreshHeaderCollapsed, refreshMinContentHeight]
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
const handleContainerHeight = useCallback(
|
|
111
|
-
(height: number) => {
|
|
112
|
-
containerHeight.current = height;
|
|
113
|
-
refreshMinContentHeight();
|
|
114
|
-
},
|
|
115
|
-
[refreshMinContentHeight]
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
const context = useMemo(() => {
|
|
119
|
-
return {
|
|
120
|
-
collapse: () => collapsibleHandlers.current?.collapse(),
|
|
121
|
-
expand: () => collapsibleHandlers.current?.expand(),
|
|
122
|
-
scrollTo: (offset: number, animate?: boolean) =>
|
|
123
|
-
collapsibleHandlers.current?.scrollTo(offset, animate),
|
|
124
|
-
headerHeight,
|
|
125
|
-
scrollY,
|
|
126
|
-
headerCollapsed,
|
|
127
|
-
};
|
|
128
|
-
}, [scrollY, headerHeight, headerCollapsed]);
|
|
129
|
-
|
|
130
|
-
const internalContext = useMemo(
|
|
131
|
-
() => ({
|
|
132
|
-
containerRef,
|
|
133
|
-
handleStickyViewLayout,
|
|
134
|
-
handleHeaderContainerLayout,
|
|
135
|
-
setCollapsibleHandlers,
|
|
136
|
-
handleContainerHeight,
|
|
137
|
-
firstStickyViewY,
|
|
138
|
-
stickyViewTops,
|
|
139
|
-
fixedHeaderHeight,
|
|
140
|
-
stickyHeaderHeight,
|
|
141
|
-
contentMinHeight,
|
|
142
|
-
}),
|
|
143
|
-
[
|
|
144
|
-
setCollapsibleHandlers,
|
|
145
|
-
handleStickyViewLayout,
|
|
146
|
-
handleHeaderContainerLayout,
|
|
147
|
-
handleContainerHeight,
|
|
148
|
-
firstStickyViewY,
|
|
149
|
-
stickyViewTops,
|
|
150
|
-
fixedHeaderHeight,
|
|
151
|
-
stickyHeaderHeight,
|
|
152
|
-
contentMinHeight,
|
|
153
|
-
]
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
return (
|
|
157
|
-
<CollapsibleContext.Provider value={context}>
|
|
158
|
-
<InternalCollapsibleContext.Provider value={internalContext}>
|
|
159
|
-
<Component {...props} />
|
|
160
|
-
</InternalCollapsibleContext.Provider>
|
|
161
|
-
</CollapsibleContext.Provider>
|
|
162
|
-
);
|
|
163
|
-
};
|
|
164
|
-
}
|