about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-08-31 16:23:10 +0200
committerGitHub <noreply@github.com>2022-08-31 16:23:10 +0200
commit156c6ea36ceb080ca4be007bcfdda52e907937aa (patch)
tree3134e5d6b02ac7eca18bf2024fb5c3d15d97f1e2
parent0fece174f6fd4dcdf53974889a1fe5618fb34bf3 (diff)
Fix position of “expand” icon in media modal on glitch-soc (#1838)
-rw-r--r--app/javascript/flavours/glitch/components/icon_button.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/icon_button.js b/app/javascript/flavours/glitch/components/icon_button.js
index 9ff745355..c0664ec89 100644
--- a/app/javascript/flavours/glitch/components/icon_button.js
+++ b/app/javascript/flavours/glitch/components/icon_button.js
@@ -84,15 +84,21 @@ export default class IconButton extends React.PureComponent {
   }
 
   render () {
+    // Hack required for some icons which have an overriden size
+    let containerSize = '1.28571429em';
+    if (this.props.style?.fontSize) {
+      containerSize = `${this.props.size * 1.28571429}px`;
+    }
+
     let style = {
       fontSize: `${this.props.size}px`,
-      height: '1.28571429em',
+      height: containerSize,
       lineHeight: `${this.props.size}px`,
       ...this.props.style,
       ...(this.props.active ? this.props.activeStyle : {}),
     };
     if (!this.props.label) {
-      style.width = '1.28571429em';
+      style.width = containerSize;
     } else {
       style.textAlign = 'left';
     }