mirror of
https://gitlab.com/questable/questable-web-ui
synced 2025-12-24 04:50:06 +01:00
Break into files
This commit is contained in:
20
src/components/login.js
Normal file
20
src/components/login.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import React, { useState } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
export default (player) => {
|
||||
function Login(props) {
|
||||
const [input, setInput] = useState("");
|
||||
return (
|
||||
<div className="login">
|
||||
<input type="text" placeholder="Token ID" value={input}
|
||||
onChange={evt => setInput(evt.target.value)} />
|
||||
<button onClick={() => player.auth(input).then(x => props.setLoggedIn(x))}>Submit</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Login.propTypes = {
|
||||
setLoggedIn: PropTypes.func,
|
||||
};
|
||||
return Login;
|
||||
};
|
||||
7
src/components/mainapp.js
Normal file
7
src/components/mainapp.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import React from "react";
|
||||
export default () => function MainApp() {
|
||||
return (
|
||||
<div className="main">
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user