From 2a5733e654d03514495aa9157b27eab0fd1c82e4 Mon Sep 17 00:00:00 2001 From: Lungsang <102473656+Lungsangg@users.noreply.github.com> Date: Fri, 31 Jan 2025 17:14:02 +0530 Subject: [PATCH] CloseButton_component_changes_revert --- static/js/Misc.jsx | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/static/js/Misc.jsx b/static/js/Misc.jsx index 1d66ea0d3e..afd09a1ef1 100644 --- a/static/js/Misc.jsx +++ b/static/js/Misc.jsx @@ -1348,38 +1348,21 @@ MenuButton.propTypes = { class CloseButton extends Component { - onClick = (e) => { - e.preventDefault(); // Prevent the default anchor behavior - e.stopPropagation(); // Stop event bubbling - - // Use a small timeout to ensure onClick completes - setTimeout(() => { - window.history.go(-1); - }, 0); + onClick(e) { + e.preventDefault(); + this.props.onClick(); } - render() { - let icon; - if (this.props.icon == "circledX") { - icon = Close; + if (this.props.icon == "circledX"){ + var icon = ; } else if (this.props.icon == "chevron") { - icon = ; + var icon = } else { - icon = ; + var icon = "×"; } - - const classes = classNames({ - readerNavMenuCloseButton: 1, - circledX: this.props.icon === "circledX" - }); - - const url = this.props.url || "#"; // Use # as fallback to prevent page reload - - return ( - - {icon} - - ); + var classes = classNames({readerNavMenuCloseButton: 1, circledX: this.props.icon === "circledX"}); + var url = this.props.url || ""; + return ({icon}); } }