ソースを参照

fix(calendar): join button goes to meeting

master
Leonard Kim 7年前
コミット
f148b50100

+ 3
- 1
react/features/calendar-sync/components/BaseCalendarList.js ファイルの表示

202
     _toDisplayableItem(event) {
202
     _toDisplayableItem(event) {
203
         return {
203
         return {
204
             elementAfter: event.url
204
             elementAfter: event.url
205
-                ? <JoinButton onPress = { this._onJoinPress } />
205
+                ? <JoinButton
206
+                    onPress = { this._onJoinPress }
207
+                    url = { event.url } />
206
                 : (<AddMeetingUrlButton
208
                 : (<AddMeetingUrlButton
207
                     calendarId = { event.calendarId }
209
                     calendarId = { event.calendarId }
208
                     eventId = { event.id } />),
210
                     eventId = { event.id } />),

+ 33
- 2
react/features/calendar-sync/components/JoinButton.web.js ファイルの表示

16
      */
16
      */
17
     onPress: Function,
17
     onPress: Function,
18
 
18
 
19
+    /**
20
+     * The meeting URL associated with the {@link JoinButton} instance.
21
+     */
22
+    url: string,
23
+
19
     /**
24
     /**
20
      * Invoked to obtain translated strings.
25
      * Invoked to obtain translated strings.
21
      */
26
      */
29
  */
34
  */
30
 class JoinButton extends Component<Props> {
35
 class JoinButton extends Component<Props> {
31
 
36
 
37
+    /**
38
+     * Initializes a new {@code JoinButton} instance.
39
+     *
40
+     * @param {*} props - The read-only properties with which the new instance
41
+     * is to be initialized.
42
+     */
43
+    constructor(props) {
44
+        super(props);
45
+
46
+        // Bind event handler so it is only bound once for every instance.
47
+        this._onClick = this._onClick.bind(this);
48
+    }
49
+
32
     /**
50
     /**
33
      * Implements React's {@link Component#render}.
51
      * Implements React's {@link Component#render}.
34
      *
52
      *
35
      * @inheritdoc
53
      * @inheritdoc
36
      */
54
      */
37
     render() {
55
     render() {
38
-        const { onPress, t } = this.props;
56
+        const { t } = this.props;
39
 
57
 
40
         return (
58
         return (
41
             <Tooltip
59
             <Tooltip
43
                 <Button
61
                 <Button
44
                     appearance = 'primary'
62
                     appearance = 'primary'
45
                     className = 'join-button'
63
                     className = 'join-button'
46
-                    onClick = { onPress }
64
+                    onClick = { this._onClick }
47
                     type = 'button'>
65
                     type = 'button'>
48
                     { t('calendarSync.join') }
66
                     { t('calendarSync.join') }
49
                 </Button>
67
                 </Button>
50
             </Tooltip>
68
             </Tooltip>
51
         );
69
         );
52
     }
70
     }
71
+
72
+    _onClick: (Object) => void;
73
+
74
+    /**
75
+     * Callback invoked when the component is clicked.
76
+     *
77
+     * @param {Object} event - The DOM click event.
78
+     * @private
79
+     * @returns {void}
80
+     */
81
+    _onClick(event) {
82
+        this.props.onPress(event, this.props.url);
83
+    }
53
 }
84
 }
54
 
85
 
55
 export default translate(JoinButton);
86
 export default translate(JoinButton);

読み込み中…
キャンセル
保存