]> Untitled Git - lemmy-ui.git/commitdiff
Add a link to joinlemmy on lemmy.ml signup. Fixes #235
authorDessalines <tyhou13@gmx.com>
Tue, 4 May 2021 18:51:16 +0000 (14:51 -0400)
committerDessalines <tyhou13@gmx.com>
Tue, 4 May 2021 18:51:16 +0000 (14:51 -0400)
src/shared/components/login.tsx

index 7a305f513704279a093f53dabc61065b4155d8c1..c8ce80fad295ae738280ae3c24f4ea23f2e07d04 100644 (file)
@@ -21,10 +21,12 @@ import {
   wsUserOp,
   wsClient,
   authField,
+  joinLemmyUrl,
 } from "../utils";
 import { i18n } from "../i18next";
 import { HtmlTags } from "./html-tags";
 import { Icon, Spinner } from "./icon";
+import { T } from "inferno-i18next";
 
 interface State {
   loginForm: LoginForm;
@@ -83,6 +85,10 @@ export class Login extends Component<any, State> {
     return `${i18n.t("login")} - ${this.state.site_view.site.name}`;
   }
 
+  get isLemmyMl(): boolean {
+    return isBrowser() && window.location.hostname == "lemmy.ml";
+  }
+
   render() {
     return (
       <div class="container">
@@ -296,6 +302,13 @@ export class Login extends Component<any, State> {
             </div>
           </div>
         )}
+        {this.isLemmyMl && (
+          <div class="mt-2 mb-0 alert alert-light" role="alert">
+            <T i18nKey="lemmy_ml_registration_message">
+              #<a href={joinLemmyUrl}>#</a>
+            </T>
+          </div>
+        )}
         <div class="form-group row">
           <div class="col-sm-10">
             <button type="submit" class="btn btn-secondary">