From 156c6ea36ceb080ca4be007bcfdda52e907937aa Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 31 Aug 2022 16:23:10 +0200 Subject: Fix position of “expand” icon in media modal on glitch-soc (#1838) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/flavours/glitch/components/icon_button.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/components') 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'; } -- cgit