feat: show language widget in signup and signin pages (#1180)

This commit is contained in:
Yaodong Yu 2022-10-03 22:40:19 +08:00 committed by GitHub
parent 5abcf913e6
commit 6da452d7e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 29 deletions

View File

@ -610,7 +610,7 @@ class App extends Component {
// theme="dark"
mode={(Setting.isMobile() && this.isStartPages()) ? "inline" : "horizontal"}
selectedKeys={[`${this.state.selectedMenuKey}`]}
style={{lineHeight: "64px", width: "80%", position: "absolute", left: "145px"}}
style={{lineHeight: "64px", width: "78%", position: "absolute", left: "145px"}}
>
{
this.renderMenu()

View File

@ -59,6 +59,12 @@
height: 70px; /* Footer height */
}
#language-box-corner {
position: absolute;
top: 75px;
right: 0;
}
.language_box {
background: url("@{StaticBaseUrl}/img/muti_language.svg");
background-size: 25px, 25px;
@ -88,6 +94,16 @@
align-items: stretch;
}
.login-content{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
box-sizing: border-box;
margin: 0 auto;
position: relative;
}
.loginBackground {
height: 100%;
background: #fff no-repeat;

View File

@ -49,7 +49,7 @@ class SelectLanguageBox extends React.Component {
return (
<Dropdown overlay={menu} >
<div className="language_box" />
<div className="language_box" id={this.props.id} style={this.props.style} />
</Dropdown>
);
}

View File

@ -28,6 +28,7 @@ import SelfLoginButton from "./SelfLoginButton";
import i18next from "i18next";
import CustomGithubCorner from "../CustomGithubCorner";
import {CountDownInput} from "../common/CountDownInput";
import SelectLanguageBox from "../SelectLanguageBox";
const {TabPane} = Tabs;
@ -700,7 +701,9 @@ class LoginPage extends React.Component {
<CustomGithubCorner />
<Row>
<Col span={8} offset={application.formOffset === 0 || Setting.inIframe() || Setting.isMobile() ? 8 : application.formOffset} style={{display: "flex", justifyContent: "center"}}>
<div className="login-content">
<div style={{marginTop: "80px", marginBottom: "50px", textAlign: "center", ...formStyle}}>
<SelectLanguageBox id="language-box-corner" style={{top: "80px", right: "5px"}} />
<div>
{
Setting.renderHelmet(application)
@ -719,6 +722,7 @@ class LoginPage extends React.Component {
}
</div>
</div>
</div>
</Col>
</Row>
</div>

View File

@ -25,6 +25,7 @@ import * as ApplicationBackend from "../backend/ApplicationBackend";
import {CountDownInput} from "../common/CountDownInput";
import SelectRegionBox from "../SelectRegionBox";
import CustomGithubCorner from "../CustomGithubCorner";
import SelectLanguageBox from "../SelectLanguageBox";
const formItemLayout = {
labelCol: {
@ -622,7 +623,9 @@ class SignupPage extends React.Component {
&nbsp;
<Row>
<Col span={8} offset={application.formOffset === 0 || Setting.inIframe() || Setting.isMobile() ? 8 : application.formOffset} style={{display: "flex", justifyContent: "center"}} >
<div className="login-content">
<div style={{marginBottom: "10px", textAlign: "center", ...formStyle}}>
<SelectLanguageBox id="language-box-corner" style={{top: "3px", right: "5px"}} />
{
Setting.renderHelmet(application)
}
@ -633,6 +636,7 @@ class SignupPage extends React.Component {
this.renderForm(application)
}
</div>
</div>
</Col>
</Row>
{