瀏覽代碼

fix: render notification description on mobile

master
Bettenbuk Zoltan 5 年之前
父節點
當前提交
a2cbd9229a
共有 1 個檔案被更改,包括 11 行新增10 行删除
  1. 11
    10
      react/features/notifications/components/native/Notification.js

+ 11
- 10
react/features/notifications/components/native/Notification.js 查看文件

@@ -64,25 +64,26 @@ class Notification extends AbstractNotification<Props> {
64 64
     _renderContent() {
65 65
         const { t, title, titleArguments, titleKey } = this.props;
66 66
         const titleText = title || (titleKey && t(titleKey, titleArguments));
67
+        const description = this._getDescription();
67 68
 
68
-        if (titleText) {
69
-            return (
69
+        if (description && description.length) {
70
+            return description.map((line, index) => (
70 71
                 <Text
72
+                    key = { index }
71 73
                     numberOfLines = { 1 }
72
-                    style = { styles.contentText } >
73
-                    { titleText }
74
+                    style = { styles.contentText }>
75
+                    { line }
74 76
                 </Text>
75
-            );
77
+            ));
76 78
         }
77 79
 
78
-        return this._getDescription().map((line, index) => (
80
+        return (
79 81
             <Text
80
-                key = { index }
81 82
                 numberOfLines = { 1 }
82
-                style = { styles.contentText }>
83
-                { line }
83
+                style = { styles.contentText } >
84
+                { titleText }
84 85
             </Text>
85
-        ));
86
+        );
86 87
     }
87 88
 
88 89
     _getDescription: () => Array<string>;

Loading…
取消
儲存