Merge branch 'master' of ssh://cryps.gg:40022/~/cryps
This commit is contained in:
Regular → Executable
+13
-1
@@ -1,7 +1,7 @@
|
||||
// eslint-disable-next-line
|
||||
const preact = require('preact');
|
||||
|
||||
function renderLogin({ account, submitLogin }) {
|
||||
function renderLogin({ account, submitLogin, submitRegister}) {
|
||||
if (account) return <div>{JSON.stringify(account)}</div>;
|
||||
|
||||
const details = {
|
||||
@@ -42,12 +42,24 @@ function renderLogin({ account, submitLogin }) {
|
||||
</div>
|
||||
<div className="field">
|
||||
<p className="control">
|
||||
<button
|
||||
className="button inverted"
|
||||
type="submit"
|
||||
onClick={() => submitLogin("ntr", "grepgrepgrep")}>
|
||||
Default
|
||||
</button>
|
||||
<button
|
||||
className="button inverted"
|
||||
type="submit"
|
||||
onClick={() => submitLogin(details.name, details.password)}>
|
||||
Login
|
||||
</button>
|
||||
<button
|
||||
className="button inverted"
|
||||
type="submit"
|
||||
onClick={() => submitRegister(details.name, details.password)}>
|
||||
Register
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Regular → Executable
+4
-2
@@ -8,8 +8,10 @@ const addState = connect(
|
||||
function submitLogin(name, password) {
|
||||
return ws.sendAccountLogin(name, password);
|
||||
}
|
||||
|
||||
return { account: state.account, submitLogin };
|
||||
function submitRegister(name, password) {
|
||||
return ws.sendAccountRegister(name, password);
|
||||
}
|
||||
return { account: state.account, submitLogin, submitRegister };
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user