only wrap e2e icon in button if there is a click handler

pull/21833/head
Bruno Windels 2019-02-12 19:59:31 +01:00
parent 5e298dc58d
commit bfdf1251e8
1 changed files with 6 additions and 3 deletions

View File

@ -36,7 +36,10 @@ export default function(props) {
_t("All devices for this user are trusted") : _t("All devices for this user are trusted") :
_t("All devices in this encrypted room are trusted"); _t("All devices in this encrypted room are trusted");
} }
return (<AccessibleButton onClick={props.onClick}> const icon = (<div className={e2eIconClasses} title={e2eTitle} />);
<div className={e2eIconClasses} title={e2eTitle} /> if (props.onClick) {
</AccessibleButton>); return (<AccessibleButton onClick={props.onClick}>{ icon }</AccessibleButton>);
} else {
return icon;
}
} }