about summary refs log tree commit diff
path: root/app/javascript/flavours
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-09-09 16:51:14 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-09-09 17:14:09 +0200
commit7aa4d481db4ad5dfa65e5b28a5a83f643cea5763 (patch)
tree6bd8952e8809be40cf1c8dcfb1326a166cf513fb /app/javascript/flavours
parent4a94f4127b57176f73e7de136137aa7efe9a0140 (diff)
Fix media icons not being added in CWs
Diffstat (limited to 'app/javascript/flavours')
-rw-r--r--app/javascript/flavours/glitch/components/status_content.js26
1 files changed, 14 insertions, 12 deletions
diff --git a/app/javascript/flavours/glitch/components/status_content.js b/app/javascript/flavours/glitch/components/status_content.js
index 3a9b23228..82d066432 100644
--- a/app/javascript/flavours/glitch/components/status_content.js
+++ b/app/javascript/flavours/glitch/components/status_content.js
@@ -70,7 +70,7 @@ export default class StatusContent extends React.PureComponent {
     collapsed: PropTypes.bool,
     onExpandedToggle: PropTypes.func,
     media: PropTypes.node,
-    mediaIcon: PropTypes.string,
+    mediaIcons: PropTypes.arrayOf(PropTypes.string),
     parseClick: PropTypes.func,
     disabled: PropTypes.bool,
     onUpdate: PropTypes.func,
@@ -256,7 +256,7 @@ export default class StatusContent extends React.PureComponent {
     const {
       status,
       media,
-      mediaIcon,
+      mediaIcons,
       parseClick,
       disabled,
       tagLinks,
@@ -295,16 +295,18 @@ export default class StatusContent extends React.PureComponent {
             key='0'
           />,
         ];
-        if (mediaIcon) {
-          toggleText.push(
-            <Icon
-              fixedWidth
-              className='status__content__spoiler-icon'
-              id={mediaIcon}
-              aria-hidden='true'
-              key='1'
-            />,
-          );
+        if (mediaIcons) {
+          mediaIcons.forEach((mediaIcon, idx) => {
+            toggleText.push(
+              <Icon
+                fixedWidth
+                className='status__content__spoiler-icon'
+                id={mediaIcon}
+                aria-hidden='true'
+                key={`icon-${idx}`}
+              />,
+            );
+          });
         }
       } else {
         toggleText = (