MCPcopy Index your code
hub / github.com/BlueWallet/BlueWallet / DrawerRoot

Function DrawerRoot

navigation/DrawerRoot.tsx:36–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34};
35
36const DrawerRoot = () => {
37 const { sizeClass, isLargeScreen } = useSizeClass();
38 const { direction } = useLocale();
39 useCompanionListeners();
40
41 const getDrawerWidth = useMemo(() => {
42 switch (sizeClass) {
43 case SizeClass.Large:
44 return 320;
45 case SizeClass.Regular:
46 return 280;
47 default:
48 return 0;
49 }
50 }, [sizeClass]);
51
52 const drawerStyle: DrawerNavigationOptions = useMemo(
53 () => ({
54 drawerPosition: direction === 'rtl' ? 'right' : 'left',
55 drawerStyle: {
56 width: getDrawerWidth,
57 height: '100%',
58 },
59 drawerType: isLargeScreen ? 'permanent' : 'front',
60 overlayColor: 'rgba(0,0,0,0.4)',
61 swipeEnabled: false,
62
63 ...getAnimationConfig(true),
64 }),
65 [getDrawerWidth, isLargeScreen, direction],
66 );
67
68 useEffect(() => {
69 console.debug('[DrawerRoot] Size class changed:', SizeClass[sizeClass]);
70 }, [sizeClass]);
71
72 return (
73 <Drawer.Navigator
74 screenOptions={drawerStyle}
75 drawerContent={DrawerContent}
76 initialRouteName="DetailViewStackScreensStack"
77 defaultStatus={isLargeScreen ? 'open' : 'closed'}
78 >
79 <Drawer.Screen name="DetailViewStackScreensStack" component={DetailViewStackScreensStack} options={{ headerShown: false }} />
80 </Drawer.Navigator>
81 );
82};
83
84export default DrawerRoot;

Callers

nothing calls this directly

Calls 3

useSizeClassFunction · 0.90
useCompanionListenersFunction · 0.85
getAnimationConfigFunction · 0.85

Tested by

no test coverage detected