Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
troyeguo committed Aug 27, 2023
1 parent 7fb4c25 commit cbda6b4
Show file tree
Hide file tree
Showing 25 changed files with 344 additions and 80 deletions.
1 change: 0 additions & 1 deletion public/assets/styles/blue.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.delete-dialog-comfirm,
.book-item-config,
.book-cover-item-config,
.side-menu-selector-container,
.download-desk-button,
.edit-dialog-comfirm,
.change-location-button,
Expand Down
1 change: 0 additions & 1 deletion public/assets/styles/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ body,
.delete-dialog-comfirm,
.book-item-config,
.book-cover-item-config,
.side-menu-selector-container,
.download-desk-button,
.edit-dialog-comfirm,
.change-location-button,
Expand Down
1 change: 0 additions & 1 deletion public/assets/styles/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ body,
.delete-dialog-comfirm,
.book-item-config,
.book-cover-item-config,
.side-menu-selector-container,
.download-desk-button,
.edit-dialog-comfirm,
.change-location-button,
Expand Down
1 change: 0 additions & 1 deletion public/assets/styles/green.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.delete-dialog-comfirm,
.book-item-config,
.book-cover-item-config,
.side-menu-selector-container,
.download-desk-button,
.edit-dialog-comfirm,
.change-location-button,
Expand Down
1 change: 0 additions & 1 deletion public/assets/styles/purple.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.delete-dialog-comfirm,
.book-item-config,
.book-cover-item-config,
.side-menu-selector-container,
.download-desk-button,
.edit-dialog-comfirm,
.change-location-button,
Expand Down
1 change: 0 additions & 1 deletion public/assets/styles/red.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
.update-dialog-container-button,
.import-from-local,
.single-control-switch,
.side-menu-selector-container,
.previous-chapter-single-container,
.next-chapter-single-container,
.book-bookmark-link,
Expand Down
5 changes: 3 additions & 2 deletions src/assets/locales/cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,10 @@
"Chinese Conversion": "繁简转换",
"Don't use first page as PDF cover": "不使用 PDF 首页作为封面",
"Don't crop book cover": "不裁剪图书封面",
"Add to favorite": "添加到喜爱",
"Remove from favorite": "从喜爱移除",
"Add to Favorite": "添加到喜爱",
"Remove from Favorite": "从喜爱移除",
"Details": "详细信息",
"Multiple Select": "多选",
"You may see this error when the book you're importing is not supported by Koodo Reader, try converting it with Calibre": "暂不支持此图书,请尝试使用 Calibre 转化之后重新导入",
"Shelf title can't be pure number": "书架名不能是纯数字",
"Open Console": "打开控制台",
Expand Down
1 change: 1 addition & 0 deletions src/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"Add to favorite": "Add to favorite",
"Remove from favorite": "Remove from favorite",
"Details": "Details",
"Multiple Select": "Multiple Select",
"You may see this error when the book you're importing is not supported by Koodo Reader, try converting it with Calibre": "You may see this error when the book you're importing is not supported by Koodo Reader, try converting it with Calibre",
"Simplified To Traditional": "Simplified To Traditional",
"Traditional To Simplified": "Traditional To Simplified",
Expand Down
Binary file modified src/assets/styles/fonts/icomoon.eot
Binary file not shown.
11 changes: 11 additions & 0 deletions src/assets/styles/fonts/icomoon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/styles/fonts/icomoon.ttf
Binary file not shown.
Binary file modified src/assets/styles/fonts/icomoon.woff
Binary file not shown.
43 changes: 38 additions & 5 deletions src/assets/styles/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?o3qvp2');
src: url('fonts/icomoon.eot?o3qvp2#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?o3qvp2') format('truetype'),
url('fonts/icomoon.woff?o3qvp2') format('woff'),
url('fonts/icomoon.svg?o3qvp2#icomoon') format('svg');
src: url('fonts/icomoon.eot?43s8j0');
src: url('fonts/icomoon.eot?43s8j0#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?43s8j0') format('truetype'),
url('fonts/icomoon.woff?43s8j0') format('woff'),
url('fonts/icomoon.svg?43s8j0#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
Expand All @@ -25,6 +25,39 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-bookshelf-line:before {
content: "\e94b";
}
.icon-highlight-line:before {
content: "\e94c";
}
.icon-select:before {
content: "\e94d";
}
.icon-trash-line:before {
content: "\e943";
}
.icon-detail:before {
content: "\e944";
}
.icon-bookshelf:before {
content: "\e945";
}
.icon-edit-line:before {
content: "\e946";
}
.icon-address-book:before {
content: "\e947";
}
.icon-idea-line:before {
content: "\e948";
}
.icon-heart:before {
content: "\e949";
}
.icon-home-line:before {
content: "\e94a";
}
.icon-day:before {
content: "\e936";
}
Expand Down
36 changes: 27 additions & 9 deletions src/components/dialogs/actionDialog/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class ActionDialog extends React.Component<
toast.success(this.props.t("Add Successfully"));
this.props.handleActionDialog(false);
};
handleMultiSelect = () => {
this.props.handleSelectBook(true);
this.props.handleSelectedBooks([this.props.currentBook.key]);
this.props.handleActionDialog(false);
};
handleCancelLoveBook = () => {
AddFavorite.clear(this.props.currentBook.key);
if (
Expand Down Expand Up @@ -125,14 +130,14 @@ class ActionDialog extends React.Component<
}
}}
>
<span className="icon-love view-icon"></span>
<span className="icon-heart view-icon"></span>
<p className="action-name">
{AddFavorite.getAllFavorite().indexOf(
this.props.currentBook.key
) > -1 ? (
<Trans>Remove from favorite</Trans>
<Trans>Remove from Favorite</Trans>
) : (
<Trans>Add to favorite</Trans>
<Trans>Add to Favorite</Trans>
)}
</p>
</div>
Expand All @@ -142,18 +147,29 @@ class ActionDialog extends React.Component<
this.handleAddShelf();
}}
>
<span className="icon-shelf view-icon"></span>
<span className="icon-bookshelf-line view-icon"></span>
<p className="action-name">
<Trans>Add to Shelf</Trans>
</p>
</div>
<div
className="action-dialog-add"
onClick={() => {
this.handleMultiSelect();
}}
>
<span className="icon-select view-icon"></span>
<p className="action-name">
<Trans>Multiple Select</Trans>
</p>
</div>
<div
className="action-dialog-delete"
onClick={() => {
this.handleDeleteBook();
}}
>
<span className="icon-trash view-icon"></span>
<span className="icon-trash-line view-icon"></span>
<p className="action-name">
<Trans>Delete</Trans>
</p>
Expand All @@ -164,7 +180,7 @@ class ActionDialog extends React.Component<
this.handleEditBook();
}}
>
<span className="icon-edit view-icon"></span>
<span className="icon-edit-line view-icon"></span>
<p className="action-name">
<Trans>Edit</Trans>
</p>
Expand All @@ -176,10 +192,10 @@ class ActionDialog extends React.Component<
}}
>
<span
className="icon-idea view-icon"
className="icon-idea-line view-icon"
style={{ fontSize: "17px" }}
></span>
<p className="action-name">
<p className="action-name" style={{ marginLeft: "12px" }}>
<Trans>Details</Trans>
</p>
</div>
Expand All @@ -206,8 +222,10 @@ class ActionDialog extends React.Component<
className="icon-more view-icon"
style={{
display: "inline-block",
marginRight: "15px",
marginRight: "12px",
marginLeft: "3px",
transform: "rotate(90deg)",
fontSize: "12px",
}}
></span>
<Trans>More Actions</Trans>
Expand Down
6 changes: 6 additions & 0 deletions src/components/dialogs/actionDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { connect } from "react-redux";
import {
handleEditDialog,
handleDeleteDialog,
handleSelectBook,
handleAddDialog,
handleSelectedBooks,
handleActionDialog,
handleReadingBook,
handleFetchBooks,
Expand All @@ -19,6 +21,8 @@ const mapStateToProps = (state: stateType) => {
currentBook: state.book.currentBook,
books: state.manager.books,
notes: state.reader.notes,
isSelectBook: state.manager.isSelectBook,

deletedBooks: state.manager.deletedBooks,
};
};
Expand All @@ -30,6 +34,8 @@ const actionCreator = {
handleActionDialog,
handleFetchBooks,
handleDetailDialog,
handleSelectBook,
handleSelectedBooks,
};
export default connect(
mapStateToProps,
Expand Down
4 changes: 4 additions & 0 deletions src/components/dialogs/actionDialog/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export interface ActionDialogProps extends RouteComponentProps<any> {
left: number;
top: number;
mode: string;
isSelectBook: boolean;

handleFetchBooks: () => void;
handleDeleteDialog: (isShow: boolean) => void;
handleFetchBookmarks: () => void;
Expand All @@ -21,6 +23,8 @@ export interface ActionDialogProps extends RouteComponentProps<any> {
handleAddDialog: (isShow: boolean) => void;
handleActionDialog: (isShow: boolean) => void;
handleDetailDialog: (isShow: boolean) => void;
handleSelectBook: (isSelectBook: boolean) => void;
handleSelectedBooks: (selectedBooks: string[]) => void;
}
export interface ActionDialogState {
isShowExport: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/selectBook/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SelectBook extends React.Component<BookListProps, BookListState> {
}}
className="book-manage-title"
>
<Trans>{this.props.isSelectBook ? "Cancel" : "Select"}</Trans>
<Trans>{this.props.isSelectBook ? "Cancel" : ""}</Trans>
</span>
{this.props.isSelectBook && (
<>
Expand Down

0 comments on commit cbda6b4

Please sign in to comment.