-
-
Notifications
You must be signed in to change notification settings - Fork 632
Expand file tree
/
Copy pathStackInBottomTabsScenario.tsx
More file actions
52 lines (49 loc) · 1.52 KB
/
StackInBottomTabsScenario.tsx
File metadata and controls
52 lines (49 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React, { useCallback, useState } from 'react';
import {
SCROLL_EDGE_EFFECT_DEFAULTS,
ScrollEdgeEffects,
ScrollEdgeEffectsConfigContext,
} from './context';
import { NavigationContainer } from '@react-navigation/native';
import { BottomTabsContainer } from '../../../shared/gamma/containers/bottom-tabs/BottomTabsContainer';
import { Config } from './Config';
import { StackScenario } from './StackScenario';
import { ScrollView } from 'react-native';
export function StackInBottomTabsScenario() {
const [config, setConfig] = useState<ScrollEdgeEffects>({
...SCROLL_EDGE_EFFECT_DEFAULTS,
});
// Add ScrollView for automatic insets which are missing in BottomTabsScreen
const ConfigComponent = useCallback(
() => (
<ScrollView>
<Config title="Outer BottomTabs / scrollEdgeEffects:" />
</ScrollView>
),
[],
);
return (
<ScrollEdgeEffectsConfigContext.Provider value={{ config, setConfig }}>
<NavigationContainer>
<BottomTabsContainer
tabConfigs={[
{
component: ConfigComponent,
tabScreenProps: { tabKey: 'config', title: 'Config' },
},
{
component: StackScenario,
tabScreenProps: {
tabKey: 'stack',
title: 'Stack',
ios: {
scrollEdgeEffects: config,
}
},
},
]}
/>
</NavigationContainer>
</ScrollEdgeEffectsConfigContext.Provider>
);
}