Changing support -> donate. #59

This commit is contained in:
Dessalines 2021-09-08 18:43:12 -04:00
parent 9fa6954a04
commit 0bdd08d018
8 changed files with 38 additions and 8 deletions

@ -1 +1 @@
Subproject commit 3aadc092ceba43fee043391900b1109b7753f70b
Subproject commit e4067b8c02e8dbd9e9375518d8e28155f98cd733

View file

@ -2,6 +2,7 @@ import { Component } from "inferno";
import { Helmet } from "inferno-helmet";
import { i18n } from "../i18next";
import { T } from "inferno-i18next";
import { isBrowser } from "../utils";
const title = i18n.t("about_title");
@ -9,6 +10,13 @@ export class About extends Component<any, any> {
constructor(props: any, context: any) {
super(props, context);
}
componentDidMount() {
if (isBrowser()) {
window.scrollTo(0, 0);
}
}
render() {
return (
<div>

View file

@ -12,7 +12,7 @@ export class DonateLines extends Component<any, any> {
<>
<p>
<T i18nKey="donate_desc">
#<Link to="/support">#</Link>#
#<Link to="/donate">#</Link>#
</T>
</p>
<div class="row is-horizontal-align">

View file

@ -5,6 +5,7 @@ import { i18n } from "../i18next";
import { T } from "inferno-i18next";
import { translators } from "../translations/translators";
import { languagesAll, countries } from "countries-list";
import { isBrowser } from "../utils";
const title = i18n.t("support_title");
const avatarSize = 40;
@ -85,10 +86,17 @@ export interface Translator {
link?: string;
}
export class Support extends Component<any, any> {
export class Donate extends Component<any, any> {
constructor(props: any, context: any) {
super(props, context);
}
componentDidMount() {
if (isBrowser()) {
window.scrollTo(0, 0);
}
}
render() {
return (
<div>

View file

@ -13,7 +13,7 @@ export class LinkLine extends Component<any, any> {
<Link to="/instances">{i18n.t("join")}</Link>
<Link to="/about">{i18n.t("about")}</Link>
<Link to="/apps">{i18n.t("apps")}</Link>
<Link to="/support">{i18n.t("support")}</Link>
<Link to="/donate">{i18n.t("donate")}</Link>
<a href={`/docs/${getDocsLanguage(i18n.language)}/index.html`}>
{i18n.t("docs")}
</a>

View file

@ -4,7 +4,7 @@ import { Helmet } from "inferno-helmet";
import { DonateLines } from "./donate-lines";
import { i18n } from "../i18next";
import { T } from "inferno-i18next";
import { getDocsLanguage } from "../utils";
import { getDocsLanguage, isBrowser } from "../utils";
const title = i18n.t("lemmy_title");
@ -13,6 +13,11 @@ export class Main extends Component<any, any> {
super(props, context);
}
componentDidMount() {
if (isBrowser()) {
window.scrollTo(0, 0);
}
}
joinServer() {
return (
<Link className="button primary" to="/instances">
@ -257,7 +262,7 @@ export class Main extends Component<any, any> {
<div class="container">
<div class="text-center">
<h2>
<Link to="/support">{i18n.t("support_donate")}</Link>
<Link to="/donate">{i18n.t("support_donate")}</Link>
</h2>
<DonateLines />
</div>

View file

@ -3,7 +3,7 @@ import { Main } from "./components/main";
import { Apps } from "./components/apps";
import { Instances } from "./components/instances";
import { Contact } from "./components/contact";
import { Support } from "./components/support";
import { Donate } from "./components/donate";
import { About } from "./components/about";
export const routes: IRouteProps[] = [
@ -35,6 +35,11 @@ export const routes: IRouteProps[] = [
{
path: `/support`,
exact: true,
component: Support,
component: Donate,
},
{
path: `/donate`,
exact: true,
component: Donate,
},
];

View file

@ -14,3 +14,7 @@ let SHORTNUM_SI_FORMAT = new Intl.NumberFormat("en-US", {
export function numToSI(value: any) {
return SHORTNUM_SI_FORMAT.format(value);
}
export function isBrowser() {
return typeof window !== "undefined";
}