Refactor PopupRefer integration and simplify conditional rendering in Viewer

- Updated import from PopupMenu to PopupRefer in popupRefer component.
- Removed unused action imports in popupRefer component.
- Simplified conditional rendering for PopupRefer in Viewer component by removing format check for currentBook.
This commit is contained in:
troyeguo
2025-09-13 17:52:34 +08:00
parent 917a1166fd
commit 1720070469
3 changed files with 5 additions and 18849 deletions

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,7 @@
import {
handleSelection,
handleOpenMenu,
handleMenuMode,
handleNoteKey,
handleRenderNoteFunc,
} from "../../../store/actions";
import { handleSelection } from "../../../store/actions";
import { connect } from "react-redux";
import { stateType } from "../../../store";
import PopupMenu from "./component";
import PopupRefer from "./component";
import { withTranslation } from "react-i18next";
const mapStateToProps = (state: stateType) => {
@@ -24,4 +18,4 @@ const actionCreator = {
export default connect(
mapStateToProps,
actionCreator
)(withTranslation()(PopupMenu as any) as any);
)(withTranslation()(PopupRefer as any) as any);

View File

@@ -494,7 +494,7 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
}}
/>
) : null}
{this.props.htmlBook && this.props.currentBook.format !== "PDF" ? (
{this.props.htmlBook ? (
<PopupRefer
{...{
rendition: this.props.htmlBook.rendition,