浏览代码

[RN] Add ongoing label to calendar notifications for past meetings

j8
Bettenbuk Zoltan 7 年前
父节点
当前提交
5c7b7cd625
共有 2 个文件被更改,包括 8 次插入1 次删除
  1. 1
    0
      lang/main.json
  2. 7
    1
      react/features/calendar-sync/components/ConferenceNotification.native.js

+ 1
- 0
lang/main.json 查看文件

@@ -563,6 +563,7 @@
563 563
         "next": "Upcoming",
564 564
         "nextMeeting": "next meeting",
565 565
         "now": "Now",
566
+        "ongoingMeeting": "ongoing meeting",
566 567
         "permissionButton": "Open settings",
567 568
         "permissionMessage": "Calendar permission is required to list your meetings in the app."
568 569
     },

+ 7
- 1
react/features/calendar-sync/components/ConferenceNotification.native.js 查看文件

@@ -110,6 +110,12 @@ class ConferenceNotification extends Component<Props, State> {
110 110
         const { t } = this.props;
111 111
 
112 112
         if (event) {
113
+            const now = Date.now();
114
+            const label
115
+                = event.startDate < now && event.endDate > now
116
+                    ? 'calendarSync.ongoingMeeting'
117
+                    : 'calendarSync.nextMeeting';
118
+
113 119
             return (
114 120
                 <View
115 121
                     style = { [
@@ -126,7 +132,7 @@ class ConferenceNotification extends Component<Props, State> {
126 132
                                         styles.notificationTextContainer
127 133
                                     }>
128 134
                                     <Text style = { styles.notificationText }>
129
-                                        { t('calendarSync.nextMeeting') }
135
+                                        { t(label) }
130 136
                                     </Text>
131 137
                                     <Text style = { styles.notificationText }>
132 138
                                         {

正在加载...
取消
保存