From b056175d4ca9f609689d143250c32be84b121d7a Mon Sep 17 00:00:00 2001 From: sienori Date: Sun, 20 Oct 2019 19:24:40 +0900 Subject: [PATCH] Add Patreon link --- src/_locales/en/messages.json | 6 +++++ src/common/personalUrls.js | 1 + src/options/components/InformationPage.js | 33 +++++++++++++++++++++-- src/popup/components/Header.js | 10 +++---- 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 78573d4..c65165a 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -9,6 +9,9 @@ "donateWithPaypalLabel": { "message": "Donate with PayPal" }, + "donateLabel": { + "message": "Donate" + }, "enableOnThisPage": { "message": "Enable translation on this page" }, @@ -277,6 +280,9 @@ "informationLabel": { "message": "Information" }, + "backersLabel": { + "message": "Backers" + }, "licenseLabel": { "message": "License" }, diff --git a/src/common/personalUrls.js b/src/common/personalUrls.js index b641575..38c97d3 100644 --- a/src/common/personalUrls.js +++ b/src/common/personalUrls.js @@ -4,5 +4,6 @@ const browserName = browserInfo().name; const suffix = browserName === "Chrome" ? "fc" : ""; 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 patreonLink = "https://www.patreon.com/sienori"; export const chromeExtensionUrl = `https://chrome.google.com/webstore/detail/ibplnjkanclpjokhdolnendpplpjiace`; export const firefoxAddonUrl = `https://addons.mozilla.org/firefox/addon/simple-translate/`; diff --git a/src/options/components/InformationPage.js b/src/options/components/InformationPage.js index 2fb4c63..6b11fd7 100644 --- a/src/options/components/InformationPage.js +++ b/src/options/components/InformationPage.js @@ -3,7 +3,13 @@ import browser from "webextension-polyfill"; import browserInfo from "browser-info"; import queryString from "query-string"; import OptionsContainer from "./OptionContainer"; -import { paypalLink, email, chromeExtensionUrl, firefoxAddonUrl } from "src/common/personalUrls"; +import { + paypalLink, + patreonLink, + email, + chromeExtensionUrl, + firefoxAddonUrl +} from "src/common/personalUrls"; import manifest from "src/manifest-chrome.json"; export default props => { @@ -24,6 +30,13 @@ export default props => { Version {extensionVersion} +   + + {browser.i18n.getMessage("backersLabel")} +

} /> @@ -36,13 +49,29 @@ export default props => { />
+ + Donate + + } + /> - Donate + Donate } /> diff --git a/src/popup/components/Header.js b/src/popup/components/Header.js index 47d0bb4..cbfae0f 100644 --- a/src/popup/components/Header.js +++ b/src/popup/components/Header.js @@ -1,15 +1,15 @@ import React from "react"; import browser from "webextension-polyfill"; import openUrl from "src/common/openUrl"; -import { paypalLink } from "src/common/personalUrls"; +import { patreonLink } from "src/common/personalUrls"; import HeartIcon from "../icons/heart.svg"; import SettingsIcon from "../icons/settings.svg"; import Toggle from "react-toggle"; import "react-toggle/style.css"; import "../styles/header.scss"; -const openPayPal = () => { - openUrl(paypalLink); +const openPatreon = () => { + openUrl(patreonLink); }; const openSettings = () => { const url = "../options/index.html#settings"; @@ -36,8 +36,8 @@ export default props => (