Use helmet on login, signup pages.

This commit is contained in:
Yang Luo
2021-04-29 21:28:24 +08:00
parent 3065bacad2
commit 785f306c4b
5 changed files with 46 additions and 13 deletions

View File

@ -19,6 +19,7 @@ import "./i18n";
import i18next from "i18next";
import copy from "copy-to-clipboard";
import {authConfig} from "./auth/Auth";
import {Helmet} from "react-helmet";
export let ServerUrl = "";
@ -210,3 +211,16 @@ export function goToLogin(ths, application) {
goToLink(`${application.homepageUrl}/login`);
}
}
export function renderHelmet(application) {
if (application === undefined || application === null || application.organizationObj === undefined || application.organizationObj === null ||application.organizationObj === "") {
return null;
}
return (
<Helmet>
<title>{application.organizationObj.displayName}</title>
<link rel="icon" href={application.organizationObj.favicon} />
</Helmet>
)
}

View File

@ -25,6 +25,7 @@ import {GithubLoginButton, GoogleLoginButton} from "react-social-login-buttons";
import QqLoginButton from "./QqLoginButton";
import i18next from "i18next";
import {authConfig} from "./Auth";
import {Helmet} from "react-helmet";
class LoginPage extends React.Component {
constructor(props) {
@ -282,6 +283,9 @@ class LoginPage extends React.Component {
<Row>
<Col span={24} style={{display: "flex", justifyContent: "center"}}>
<div style={{marginTop: "80px", textAlign: "center"}}>
{
Setting.renderHelmet(application)
}
{
Setting.renderLogo(application)
}

View File

@ -56,6 +56,9 @@ class ResultPage extends React.Component {
return (
<div>
{
Setting.renderHelmet(application)
}
<Result
status="success"
title={i18next.t("signup:Your account has been created!")}

View File

@ -294,6 +294,9 @@ class SignupPage extends React.Component {
<Row>
<Col span={24} style={{display: "flex", justifyContent: "center"}} >
<div style={{marginTop: "10px", textAlign: "center"}}>
{
Setting.renderHelmet(application)
}
{
Setting.renderLogo(application)
}