서민정

Update test-login-page & test-register-page

1 -import React from "react"; 1 +import React, {Suspense} from "react";
2 -import { Typography, Icon } from 'antd'; 2 +import { Route, Switch } from "react-router-dom";
3 -import Chatbot from './Chatbot/Chatbot'; 3 +// import { Typography, Icon } from 'antd';
4 +// import Chatbot from './Chatbot/Chatbot';
5 +import chatpage from './views/chatpage';
6 +import loginpage from './views/loginpage';
7 +import registerpage from './views/registerpage';
4 8
5 9
6 -const { Title } = Typography; 10 +//const { Title } = Typography;
7 11
8 function App() { 12 function App() {
9 return ( 13 return (
10 - <div> 14 + <Suspense fallback = {(<div>Loading...</div>)}>
11 - <div style={{ display: 'flex', justifyContent: 'center', marginTop: '1rem' }}> 15 + <Switch>
12 - <Title level={2} >CHATBOT&nbsp;<Icon type="robot" /></Title> 16 + <Route exact path="/" component={chatpage}/>
13 - </div> 17 + <Route exact path="/login" component={loginpage} />
14 - <div style={{ display: 'flex', justifyContent: 'center' }}> 18 + <Route exact path="/register" component={registerpage} />
15 - <Chatbot /> 19 + </Switch>
16 - </div> 20 + </Suspense>
17 - </div>
18 ) 21 )
19 } 22 }
20 23
......
1 -import React, { Suspense } from "react"; 1 +import React from "react";
2 import { Typography, Icon } from 'antd'; 2 import { Typography, Icon } from 'antd';
3 import Chatbot from '../Chatbot/Chatbot'; 3 import Chatbot from '../Chatbot/Chatbot';
4 import { withRouter } from "react-router-dom"; 4 import { withRouter } from "react-router-dom";
......
1 +import React from "react";
2 +import { Typography} from 'antd';
3 +import { withRouter } from "react-router-dom";
4 +const { Title } = Typography;
5 +
6 +
7 +function loginpage() {
8 + return (
9 + <div>
10 + <div style={{ display: 'flex', justifyContent: 'center', marginTop: '1rem' }}>
11 + <Title level={2} >LoginPage Test</Title>
12 + </div>
13 + </div>
14 + )
15 +}
16 +
17 +export default withRouter(loginpage);
...\ No newline at end of file ...\ No newline at end of file
......
1 +import React from "react";
2 +import { Typography} from 'antd';
3 +import { withRouter } from "react-router-dom";
4 +const { Title } = Typography;
5 +
6 +
7 +function registerpage() {
8 + return (
9 + <div>
10 + <div style={{ display: 'flex', justifyContent: 'center', marginTop: '1rem' }}>
11 + <Title level={2} >RegisterPage Test</Title>
12 + </div>
13 + </div>
14 + )
15 +}
16 +
17 +export default withRouter(registerpage);
...\ No newline at end of file ...\ No newline at end of file
......