From 161a38ab3e97cd2f84e6315e33e4fd84e7ec5a30 Mon Sep 17 00:00:00 2001 From: troyeguo <13820674+troyeguo@users.noreply.github.com> Date: Sat, 12 Feb 2022 13:47:05 +0800 Subject: [PATCH] fix bug Former-commit-id: 052ce32c2cdedfa4247637557ef47b11a9116a08 --- .github/ISSUE_TEMPLATE/1bug_report.yml | 1 + .github/ISSUE_TEMPLATE/4bug_report_cn.yml | 1 + .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++++++++ CONTRIBUTING.md | 2 +- package.json | 2 +- src/components/popups/popupOption/component.tsx | 8 +++++++- .../readerSettings/settingSwitch/component.tsx | 6 +++++- src/constants/settingList.tsx | 1 + src/containers/panels/settingPanel/component.tsx | 4 ++-- src/utils/readUtils/styleUtil.tsx | 2 +- 10 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/1bug_report.yml b/.github/ISSUE_TEMPLATE/1bug_report.yml index d3d45709..16583671 100644 --- a/.github/ISSUE_TEMPLATE/1bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1bug_report.yml @@ -16,6 +16,7 @@ body: id: testing2 attributes: label: There are no similar issues on the issue list + description: https://github.com/troyeguo/koodo-reader/issues options: - label: "Yes" required: true diff --git a/.github/ISSUE_TEMPLATE/4bug_report_cn.yml b/.github/ISSUE_TEMPLATE/4bug_report_cn.yml index bc9453a3..c155176a 100644 --- a/.github/ISSUE_TEMPLATE/4bug_report_cn.yml +++ b/.github/ISSUE_TEMPLATE/4bug_report_cn.yml @@ -15,6 +15,7 @@ body: id: testing2 attributes: label: 我已经搜索了已有的 issue 列表,没有找到类似的 issue + description: https://github.com/troyeguo/koodo-reader/issues options: - label: "Yes" required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..55ff4483 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ + + +## Description + + +## Related Issues + + +### Checklist: + +* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../../pulls) for the same update/change? +* [ ] Have you linted your code locally prior to submission? +* [ ] Have you successfully ran app with your changes locally? diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 251fb2ba..8055fc0f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ You can find features to work on through our [Roadmap](https://www.notion.so/tro - Make sure you're already familiar with our project structure, code style, naming style. - Does not upgrade or degrade dependency version, this could potentially break the project - Does not modify current variable or function names, unless it's a typo -- Does not modify component style or add new style +- Does not modify component style ## Translation Contributing Guide diff --git a/package.json b/package.json index d740da49..e41ec0fd 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "build": { "appId": "xyz.960960.koodo", "productName": "Koodo Reader", - "copyright": "Copyright (c) 2020-2021 ${author}", + "copyright": "Copyright (c) 2021-2022 ${author}", "files": [ "build/**/*", "node_modules/**/*", diff --git a/src/components/popups/popupOption/component.tsx b/src/components/popups/popupOption/component.tsx index 889c5d17..eb54bfb5 100644 --- a/src/components/popups/popupOption/component.tsx +++ b/src/components/popups/popupOption/component.tsx @@ -157,11 +157,17 @@ class PopupOption extends React.Component { case "yahoo": this.handleJump("https://search.yahoo.com/search?p=" + getSelection()); break; + case "naver": + this.handleJump( + "https://search.naver.com/search.naver?where=nexearch&sm=top_hty&fbm=1&ie=utf8&query=" + + getSelection() + ); + break; case "baike": this.handleJump("https://baike.baidu.com/item/" + getSelection()); break; case "wiki": - this.handleJump("https://wikipedia.org/wiki/" + getSelection()); + this.handleJump("https://en.wikipedia.org/wiki/" + getSelection()); break; default: this.handleJump( diff --git a/src/components/readerSettings/settingSwitch/component.tsx b/src/components/readerSettings/settingSwitch/component.tsx index e56584c2..9c2d8c6d 100644 --- a/src/components/readerSettings/settingSwitch/component.tsx +++ b/src/components/readerSettings/settingSwitch/component.tsx @@ -65,9 +65,13 @@ class SettingSwitch extends React.Component< }, 500); }; render() { + console.log( + this.props.currentEpub, + Object.keys(this.props.currentEpub).length + ); return ( <> - {Object.keys(this.props.currentEpub).length !== 0 && } + {readerSettingList.map((item) => (
diff --git a/src/constants/settingList.tsx b/src/constants/settingList.tsx index 725660d3..eff167be 100644 --- a/src/constants/settingList.tsx +++ b/src/constants/settingList.tsx @@ -94,6 +94,7 @@ export const searchList = [ { label: "DuckDuckGo", value: "duckduckgo" }, { label: "Yandex", value: "yandex" }, { label: "Yahoo", value: "yahoo" }, + { label: "Naver", value: "naver" }, { label: "Baidu Baike", value: "baike" }, { label: "Wikipedia", value: "wiki" }, ]; diff --git a/src/containers/panels/settingPanel/component.tsx b/src/containers/panels/settingPanel/component.tsx index 621d76a0..67b98a86 100644 --- a/src/containers/panels/settingPanel/component.tsx +++ b/src/containers/panels/settingPanel/component.tsx @@ -4,7 +4,7 @@ import ThemeList from "../../../components/readerSettings/themeList"; import SliderList from "../../../components/readerSettings/sliderList"; import DropdownList from "../../../components/readerSettings/dropdownList"; import ModeControl from "../../../components/readerSettings/modeControl"; -import ReaderSwitch from "../../../components/readerSettings/settingSwitch"; +import SettingSwitch from "../../../components/readerSettings/settingSwitch"; import { SettingPanelProps, SettingPanelState } from "./interface"; import { Trans } from "react-i18next"; import StorageUtil from "../../../utils/serviceUtils/storageUtil"; @@ -133,7 +133,7 @@ class SettingPanel extends React.Component< }} /> - +
); diff --git a/src/utils/readUtils/styleUtil.tsx b/src/utils/readUtils/styleUtil.tsx index f4b319f0..3ef7a8a1 100644 --- a/src/utils/readUtils/styleUtil.tsx +++ b/src/utils/readUtils/styleUtil.tsx @@ -43,7 +43,7 @@ class styleUtil { }px !important;line-height: ${ StorageUtil.getReaderConfig("lineHeight") || "1.25" } !important;font-family: ${ - StorageUtil.getReaderConfig("fontFamily") || "Helvetica" + StorageUtil.getReaderConfig("fontFamily") || "" } !important;color: ${ StorageUtil.getReaderConfig("textColor") ? StorageUtil.getReaderConfig("textColor")