diff --git a/src/common/personalUrls.js b/src/common/personalUrls.js new file mode 100644 index 0000000..1ae3510 --- /dev/null +++ b/src/common/personalUrls.js @@ -0,0 +1,6 @@ +import browserInfo from "browser-info"; + +const browserName = browserInfo().name; +const suffix = browserName === "Chrome" ? "fc" : browserName === "Opera" ? "fo" : ""; +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`; diff --git a/src/options/components/InformationPage.js b/src/options/components/InformationPage.js index d82fe46..0eb837a 100644 --- a/src/options/components/InformationPage.js +++ b/src/options/components/InformationPage.js @@ -3,17 +3,12 @@ import browser from "webextension-polyfill"; import browserInfo from "browser-info"; import queryString from "query-string"; import OptionsContainer from "./OptionContainer"; +import { paypalLink, email } from "src/common/personalUrls"; import manifest from "src/manifest-chrome.json"; export default props => { const query = queryString.parse(props.location.search); - const extensionVersion = manifest.version; - const isChrome = browserInfo().name == "Chrome"; - const paypalLink = `https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&no_shipping=1&business=sienori.firefox@gmail.com&item_name=Simple Translate ${ - isChrome ? "for Chrome " : "" - }- Donation`; - const email = `sienori.firefox+st${isChrome ? "fc" : ""}@gmail.com`; return (