-
Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathVideoChatMenu.js
65 lines (58 loc) · 1.83 KB
/
VideoChatMenu.js
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
53
54
55
56
57
58
59
60
61
62
63
64
65
import React from 'react';
import PropTypes from 'prop-types';
import Popover from './Popover';
import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
import MenuItem from './MenuItem';
import openURLInNewTab from '../libs/openURLInNewTab';
import ZoomIcon from '../../assets/images/zoom-icon.svg';
import GoogleMeetIcon from '../../assets/images/google-meet.svg';
import CONST from '../CONST';
const propTypes = {
// State that determines whether to display the create menu or not
isVisible: PropTypes.bool.isRequired,
// Callback that determines behavior when menu is closed
onClose: PropTypes.func.isRequired,
...windowDimensionsPropTypes,
};
const VideoChatMenu = (props) => {
const menuItemData = [
{
icon: ZoomIcon,
text: 'Zoom',
onPress: () => openURLInNewTab(CONST.NEW_ZOOM_MEETING_URL),
},
{
icon: GoogleMeetIcon,
text: 'Google Meet',
onPress: () => openURLInNewTab(CONST.NEW_GOOGLE_MEET_MEETING_URL),
},
].map(item => ({
...item,
onPress: () => {
item.onPress();
props.onClose();
},
}));
return (
<Popover
onClose={props.onClose}
isVisible={props.isVisible}
anchorPosition={{
left: props.windowWidth - 250,
top: 50,
}}
>
{menuItemData.map(({icon, text, onPress}) => (
<MenuItem
key={text}
icon={icon}
title={text}
onPress={onPress}
/>
))}
</Popover>
);
};
VideoChatMenu.propTypes = propTypes;
VideoChatMenu.displayName = 'VideoChatMenu';
export default withWindowDimensions(VideoChatMenu);