|
|
@@ -1,87 +0,0 @@
|
|
1
|
|
-import PropTypes from 'prop-types';
|
|
2
|
|
-import React, { Component } from 'react';
|
|
3
|
|
-import { connect } from 'react-redux';
|
|
4
|
|
-import Button from '@atlaskit/button';
|
|
5
|
|
-
|
|
6
|
|
-import { openDialog } from '../../base/dialog';
|
|
7
|
|
-import { translate } from '../../base/i18n';
|
|
8
|
|
-import { AddPeopleDialog } from '.';
|
|
9
|
|
-
|
|
10
|
|
-/**
|
|
11
|
|
- * The button that provides different invite options.
|
|
12
|
|
- */
|
|
13
|
|
-class InviteButton extends Component {
|
|
14
|
|
- /**
|
|
15
|
|
- * {@code InviteButton}'s property types.
|
|
16
|
|
- *
|
|
17
|
|
- * @static
|
|
18
|
|
- */
|
|
19
|
|
- static propTypes = {
|
|
20
|
|
- /**
|
|
21
|
|
- * Invoked to open {@code AddPeopleDialog}.
|
|
22
|
|
- */
|
|
23
|
|
- dispatch: PropTypes.func,
|
|
24
|
|
-
|
|
25
|
|
- /**
|
|
26
|
|
- * Indicates if the "Add to call" feature is available.
|
|
27
|
|
- */
|
|
28
|
|
- enableAddPeople: PropTypes.bool,
|
|
29
|
|
-
|
|
30
|
|
- /**
|
|
31
|
|
- * Indicates if the "Dial out" feature is available.
|
|
32
|
|
- */
|
|
33
|
|
- enableDialOut: PropTypes.bool,
|
|
34
|
|
-
|
|
35
|
|
- /**
|
|
36
|
|
- * Invoked to obtain translated strings.
|
|
37
|
|
- */
|
|
38
|
|
- t: PropTypes.func
|
|
39
|
|
- };
|
|
40
|
|
-
|
|
41
|
|
- /**
|
|
42
|
|
- * Initializes a new {@code InviteButton} instance.
|
|
43
|
|
- *
|
|
44
|
|
- * @param {Object} props - The read-only properties with which the new
|
|
45
|
|
- * instance is to be initialized.
|
|
46
|
|
- */
|
|
47
|
|
- constructor(props) {
|
|
48
|
|
- super(props);
|
|
49
|
|
-
|
|
50
|
|
- // Bind event handler so it is only bound once for every instance.
|
|
51
|
|
- this._onClick = this._onClick.bind(this);
|
|
52
|
|
- }
|
|
53
|
|
-
|
|
54
|
|
- /**
|
|
55
|
|
- * Renders the content of this component.
|
|
56
|
|
- *
|
|
57
|
|
- * @returns {ReactElement}
|
|
58
|
|
- */
|
|
59
|
|
- render() {
|
|
60
|
|
- return (
|
|
61
|
|
- <div className = 'filmstrip__invite'>
|
|
62
|
|
- <div className = 'invite-button-group'>
|
|
63
|
|
- <Button
|
|
64
|
|
- onClick = { this._onClick }
|
|
65
|
|
- shouldFitContainer = { true }>
|
|
66
|
|
- { this.props.t('addPeople.invite') }
|
|
67
|
|
- </Button>
|
|
68
|
|
- </div>
|
|
69
|
|
- </div>
|
|
70
|
|
- );
|
|
71
|
|
- }
|
|
72
|
|
-
|
|
73
|
|
- /**
|
|
74
|
|
- * Opens {@code AddPeopleDialog}.
|
|
75
|
|
- *
|
|
76
|
|
- * @private
|
|
77
|
|
- * @returns {void}
|
|
78
|
|
- */
|
|
79
|
|
- _onClick() {
|
|
80
|
|
- this.props.dispatch(openDialog(AddPeopleDialog, {
|
|
81
|
|
- enableAddPeople: this.props.enableAddPeople,
|
|
82
|
|
- enableDialOut: this.props.enableDialOut
|
|
83
|
|
- }));
|
|
84
|
|
- }
|
|
85
|
|
-}
|
|
86
|
|
-
|
|
87
|
|
-export default translate(connect()(InviteButton));
|