diff --git a/bot.z_web/src/Badge.js b/bot.z_web/src/Badge.js
index b502d80..7338db6 100644
--- a/bot.z_web/src/Badge.js
+++ b/bot.z_web/src/Badge.js
@@ -1,6 +1,7 @@
import React from 'react';
+import ModalBox from './ModalBox.js';
+import { Button, Spinner } from 'react-bootstrap';
import './App.css';
-import './bootstrap.min.css';
function isCheckedIn(movements) {
@@ -68,15 +69,17 @@ class BadgePage extends React.Component {
dynButton() {
const badge = (
-
-
-
+ {this.buttonValue()}}
+ />
);
const loading =
-
- Loading...
-
;
+
+ />;
if (this.state.loading) {
return loading;
@@ -89,7 +92,7 @@ class BadgePage extends React.Component {
if (this.state.loggedIn) {
return this.dynButton();
} else {
- return (You have to login first!
);
+ return (You have to login first! />);
}
}
}
diff --git a/bot.z_web/src/IndexPage.js b/bot.z_web/src/IndexPage.js
index d41ac92..411f48b 100644
--- a/bot.z_web/src/IndexPage.js
+++ b/bot.z_web/src/IndexPage.js
@@ -1,6 +1,6 @@
import React from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
-import {Nav, Navbar} from "react-bootstrap";
+import { Nav, Navbar, Container } from "react-bootstrap";
import LoginForm from './LoginForm.js';
import MovementsPage from './Movements.js';
import BadgePage from './Badge.js';
@@ -27,7 +27,7 @@ class IndexPage extends React.Component {
BotZ
-
+
} />
} />
} />
} />
+
);
diff --git a/bot.z_web/src/LoginForm.js b/bot.z_web/src/LoginForm.js
index 38900f2..015e2b0 100644
--- a/bot.z_web/src/LoginForm.js
+++ b/bot.z_web/src/LoginForm.js
@@ -1,5 +1,6 @@
import React from 'react';
-import { Form, Button } from 'react-bootstrap';
+import { Form, Button, Spinner } from 'react-bootstrap';
+import ModalBox from './ModalBox.js';
import './App.css';
class LoginForm extends React.Component {
@@ -62,25 +63,27 @@ class LoginForm extends React.Component {
dynForm() {
const form =
-
-
Login Form
-
-
-
+ Login Form
+ data=
+
+
+
-
-
-
+
+
+
-
-
- ;
+
+
+ />;
const loading =
-
- Loading...
-
;
+
+ />;
if (this.state.loading) {
return loading;
@@ -95,7 +98,7 @@ class LoginForm extends React.Component {
render() {
if (this.state.loggedIn) {
- return (Yet logged in!
);
+ return (Yet logged in! />);
}
if (this.state.error) {
return (Error!
);
diff --git a/bot.z_web/src/Logoff.js b/bot.z_web/src/Logoff.js
index 0574da3..458c938 100644
--- a/bot.z_web/src/Logoff.js
+++ b/bot.z_web/src/Logoff.js
@@ -1,5 +1,6 @@
import React from 'react';
-import { Container } from 'react-bootstrap';
+import { Spinner, Button } from 'react-bootstrap';
+import ModalBox from './ModalBox.js';
import './App.css';
import './bootstrap.min.css';
@@ -41,17 +42,17 @@ class LogoffPage extends React.Component {
dynButton() {
const logout = (
-
-
-
+ {this.buttonValue()}
+ />
);
const loading =
-
-
- Loading...
-
- ;
+
+ />;
if (this.state.loading) {
return loading;
@@ -64,7 +65,7 @@ class LogoffPage extends React.Component {
if (this.state.loggedIn) {
return this.dynButton();
} else {
- return (You have to login first!
);
+ return (You have to login first! />);
}
}
}
diff --git a/bot.z_web/src/ModalBox.js b/bot.z_web/src/ModalBox.js
new file mode 100644
index 0000000..e56ada2
--- /dev/null
+++ b/bot.z_web/src/ModalBox.js
@@ -0,0 +1,22 @@
+import React from 'react';
+import { Modal } from 'react-bootstrap';
+import './App.css';
+
+
+class ModalBox extends React.Component {
+ render() {
+ return (
+
+
+ {this.props.title}
+
+
+ {this.props.data}
+
+
+ );
+ }
+
+}
+
+export default ModalBox;
diff --git a/bot.z_web/src/Movements.js b/bot.z_web/src/Movements.js
index 8f185da..0b92b71 100644
--- a/bot.z_web/src/Movements.js
+++ b/bot.z_web/src/Movements.js
@@ -1,10 +1,10 @@
import React from 'react';
+import ModalBox from './ModalBox.js';
import './App.css';
-import './bootstrap.min.css';
-const Empty = Empty
;
-const Error = Error
;
+const Empty = Empty />;
+const Error = Error />;
class MovementsPage extends React.Component {
@@ -25,7 +25,7 @@ class MovementsPage extends React.Component {
}
handleTable() {
- if (this.state.movements.length > 0) {
+ if (this.state.movements !== undefined) {
return {this.state.movements.map(movs => - {movs.time} - {movs.type}
)}
;
} else {
return Empty;
@@ -33,11 +33,7 @@ class MovementsPage extends React.Component {
}
render() {
- const movements =
-
-
Movements
- {this.handleTable()}
- ;
+ const movements = ;
if (this.state.error) {
return Error;
@@ -45,7 +41,7 @@ class MovementsPage extends React.Component {
if (this.state.loggedIn) {
return movements;
} else {
- return (You have to login first!
);
+ return (You have to login first! />);
}
}
}