Move lemmy.ml signup message to top of registration page (#554)

* Move lemmy.ml signup message to top of registration page

* Fix warning css class, fix message padding
This commit is contained in:
Nutomic 2022-01-27 18:44:08 +00:00 committed by GitHub
parent 1d085dea12
commit 0da5fb9623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 11 deletions

View file

@ -85,7 +85,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
placeholder={i18n.t("comment_here")}
/>
) : (
<div class="alert alert-light" role="alert">
<div class="alert alert-warning" role="alert">
<Icon icon="alert-triangle" classes="icon-inline mr-2" />
<T i18nKey="must_login" class="d-inline">
#

View file

@ -118,6 +118,7 @@ export class Signup extends Component<any, State> {
}
get isLemmyMl(): boolean {
return true;
return isBrowser() && window.location.hostname == "lemmy.ml";
}
@ -140,6 +141,16 @@ export class Signup extends Component<any, State> {
<form onSubmit={linkEvent(this, this.handleRegisterSubmit)}>
<h5>{this.titleName}</h5>
{this.isLemmyMl && (
<div class="form-group row">
<div class="mt-2 mb-0 alert alert-warning" role="alert">
<T i18nKey="lemmy_ml_registration_message">
#<a href={joinLemmyUrl}>#</a>
</T>
</div>
</div>
)}
<div class="form-group row">
<label class="col-sm-2 col-form-label" htmlFor="register-username">
{i18n.t("username")}
@ -182,7 +193,7 @@ export class Signup extends Component<any, State> {
/>
{!this.state.site_view.site.require_email_verification &&
!validEmail(this.state.registerForm.email) && (
<div class="mt-2 mb-0 alert alert-light" role="alert">
<div class="mt-2 mb-0 alert alert-warning" role="alert">
<Icon icon="alert-triangle" classes="icon-inline mr-2" />
{i18n.t("no_password_reset")}
</div>
@ -239,7 +250,7 @@ export class Signup extends Component<any, State> {
<>
<div class="form-group row">
<div class="offset-sm-2 col-sm-10">
<div class="mt-2 alert alert-light" role="alert">
<div class="mt-2 alert alert-warning" role="alert">
<Icon icon="alert-triangle" classes="icon-inline mr-2" />
{i18n.t("fill_out_application")}
</div>
@ -316,13 +327,6 @@ export class Signup 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>
)}
<input
tabIndex={-1}
autoComplete="false"

View file

@ -1,6 +1,6 @@
import { isBrowser } from "./utils";
const testHost = "localhost:8536";
const testHost = "127.0.0.1:8536";
let internalHost =
(!isBrowser() && process.env.LEMMY_INTERNAL_HOST) || testHost; // used for local dev