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

This commit is contained in:
Bruno Windels 2019-02-12 19:59:31 +01:00
parent 5e298dc58d
commit bfdf1251e8

View file

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