-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplay.tsx
34 lines (33 loc) · 917 Bytes
/
display.tsx
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* Generated with the TypeScript template
* https://github.com/react-native-community/react-native-template-typescript
*
* @format
*/
import * as React from 'react';
import {TopDrawer} from './Drawers/TopDrawer';
import {BottomDrawer} from './Drawers/BottomDrawer';
import {LeftDrawer} from './Drawers/LeftDrawer';
import {RightDrawer} from './Drawers/RightDrawer';
/**
* A function to help display the Fade Background Peekable Not Tappable drawers
* @param drawer Name of drawer to be displayed.
* @returns A sliding drawer component
*/
export const display = (drawer: string) => {
switch (drawer) {
case 'top':
return <TopDrawer />;
case 'bottom':
return <BottomDrawer />;
case 'left':
return <LeftDrawer />;
case 'right':
return <RightDrawer />;
default:
return null;
}
};