-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.js
58 lines (52 loc) · 1.73 KB
/
error.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React from 'react';
import "antd/dist/antd.css";
import './error.css';
import {Result, Input, Button} from 'antd';
import { ProjectOutlined, SendOutlined } from '@ant-design/icons';
class Error400 extends React.Component {
state = {
projectId : null,
redirect : false
}
handleChange = (e) => {
this.setState(({
projectId : e.target.value
}))
}
navigate = () => {
let host = window.location.protocol+'//'+window.location.hostname+(window.location.port ? ':'+window.location.port: '');
if(this.state.projectId){
window.location.replace(`${host}/?projectId=${this.state.projectId}`);
}
}
render(){
return (
<div className="errorContainer" >
<Result
className="errorResponse"
status="404"
title="The projectId is not valid or does not exist, please input the correct one!"
/>
<div>
<strong>ProjectId : </strong>
<Input
prefix={<ProjectOutlined />}
className="projectIdInput"
onChange={this.handleChange}
placeholder="Enter the valid projectId"
/>
<Button
className="goButton"
onClick={this.navigate}
size="large"
type="primary"
shape="round"
icon={<SendOutlined />}
>Go
</Button>
</div>
</div>
)
}
}
export default Error400;