Separate file of personal URLs

This commit is contained in:
sienori 2019-02-23 22:43:22 +09:00
parent a90ef23f6a
commit e9de9f3d1e
3 changed files with 10 additions and 16 deletions

View file

@ -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`;

View file

@ -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 (
<div>
@ -83,9 +78,7 @@ export default props => {
}
target="_blank"
>
{browserInfo().name === "Firefox"
? browser.i18n.getMessage("addonPageLabel")
: browser.i18n.getMessage("extensionPageLabel")}
{browser.i18n.getMessage("addonPageLabel")}
</a>
<span> </span>
<a href="https://github.com/sienori/simple-translate" target="_blank">

View file

@ -1,18 +1,13 @@
import React from "react";
import browser from "webextension-polyfill";
import browserInfo from "browser-info";
import openUrl from "src/common/openUrl";
import { paypalLink } from "src/common/personalUrls";
import HeartIcon from "../icons/heart.svg";
import SettingsIcon from "../icons/settings.svg";
import "../styles/header.scss";
//TODO: 次のタブで開く
const openPayPal = () => {
const isChrome = browserInfo().name === "Chrome";
const url = `https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&no_shipping=1&business=sienori.firefox@gmail.com&item_name=SimpleTranslate ${
isChrome ? "for Chrome " : ""
}- Donation`;
openUrl(url);
openUrl(paypalLink);
};
const openSettings = () => {
const url = "../options/index.html#settings";