Add chrome extension page link to settings page

This commit is contained in:
sienori 2019-03-21 20:10:01 +09:00
parent f59d9197ba
commit 6633d7df5a
3 changed files with 15 additions and 12 deletions

View file

@ -274,6 +274,9 @@
"addonPageLabel": { "addonPageLabel": {
"message": "Add-on page" "message": "Add-on page"
}, },
"extensionPageLabel": {
"message": "Extension page"
},
"amazonUrl": { "amazonUrl": {
"message": "https://www.amazon.co.jp/dp/B004N3APGO?language=en_US" "message": "https://www.amazon.co.jp/dp/B004N3APGO?language=en_US"
}, },

View file

@ -4,3 +4,5 @@ const browserName = browserInfo().name;
const suffix = browserName === "Chrome" ? "fc" : ""; const suffix = browserName === "Chrome" ? "fc" : "";
export const email = `sienori.firefox+st${suffix}@gmail.com`; export const email = `sienori.firefox+st${suffix}@gmail.com`;
export const paypalLink = `https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&no_shipping=1&business=sienori.firefox@gmail.com&item_name=Simple Translate for ${browserName} - Donation`; export const paypalLink = `https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&no_shipping=1&business=sienori.firefox@gmail.com&item_name=Simple Translate for ${browserName} - Donation`;
export const chromeExtensionUrl = `https://chrome.google.com/webstore/detail/iaiomicjabeggjcfkbimgmglanimpnae/`;
export const firefoxAddonUrl = `https://addons.mozilla.org/firefox/addon/tab-session-manager/`;

View file

@ -3,7 +3,7 @@ import browser from "webextension-polyfill";
import browserInfo from "browser-info"; import browserInfo from "browser-info";
import queryString from "query-string"; import queryString from "query-string";
import OptionsContainer from "./OptionContainer"; import OptionsContainer from "./OptionContainer";
import { paypalLink, email } from "src/common/personalUrls"; import { paypalLink, email, chromeExtensionUrl, firefoxAddonUrl } from "src/common/personalUrls";
import manifest from "src/manifest-chrome.json"; import manifest from "src/manifest-chrome.json";
export default props => { export default props => {
@ -69,17 +69,15 @@ export default props => {
extraCaption={ extraCaption={
<div> <div>
<p> <p>
<a {browserInfo().name === "Chrome" ? (
href={ <a href={chromeExtensionUrl} target="_blank">
browser.i18n.getMessage("addonUrl") {browser.i18n.getMessage("extensionPageLabel")}
/*browserInfo().name === "Firefox" </a>
? browser.i18n.getMessage("addonUrl") ) : (
: "https://chrome.google.com/webstore/detail/simple-translate/xxxxx" //TODO: Chrome link*/ <a href={firefoxAddonUrl} target="_blank">
} {browser.i18n.getMessage("addonPageLabel")}
target="_blank" </a>
> )}
{browser.i18n.getMessage("addonPageLabel")}
</a>
<span> </span> <span> </span>
<a href="https://github.com/sienori/simple-translate" target="_blank"> <a href="https://github.com/sienori/simple-translate" target="_blank">
GitHub GitHub