From 7459e19f061cbbec6497a37975cf452097b1b714 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 15 Apr 2019 17:56:36 +0200 Subject: [PATCH] fix lint --- src/components/views/rooms/RoomPreviewBar.js | 38 ++++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index b4737cab42..242e99896a 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -306,7 +306,7 @@ module.exports = React.createClass({ _t("%(errcode)s was returned while trying to access the room. If you think you're seeing this message in error, please submit a bug report.", { errcode: this.props.error.errcode }, { issueLink: label => { label } } + target="_blank" rel="noopener">{ label } }, ), ]; break; @@ -324,12 +324,6 @@ module.exports = React.createClass({ subTitleElements = subTitle.map((t, i) =>

{t}

); } - const classes = classNames("mx_RoomPreviewBar", "dark-panel", { - "mx_RoomPreviewBar_panel": this.props.canPreview, - "mx_RoomPreviewBar_dialog": !this.props.canPreview, - "mx_RoomPreviewBar_dark": darkStyle, - }); - let titleElement; if (showSpinner) { titleElement =

{ title }

; @@ -337,6 +331,30 @@ module.exports = React.createClass({ titleElement =

{ title }

; } + let primaryButton; + if (primaryActionHandler) { + primaryButton = ( + + { primaryActionLabel } + + ); + } + + let secondaryButton; + if (secondaryActionHandler) { + secondaryButton = ( + + { secondaryActionLabel } + + ); + } + + const classes = classNames("mx_RoomPreviewBar", "dark-panel", { + "mx_RoomPreviewBar_panel": this.props.canPreview, + "mx_RoomPreviewBar_dialog": !this.props.canPreview, + "mx_RoomPreviewBar_dark": darkStyle, + }); + return (
@@ -344,12 +362,10 @@ module.exports = React.createClass({ { subTitleElements }
- { secondaryActionHandler ? { secondaryActionLabel } : undefined } - { primaryActionHandler ? { primaryActionLabel } : undefined } + { secondaryButton } + { primaryButton }
); - - }, });