add wobler
This commit is contained in:
parent
66acd217e3
commit
352919581e
@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { AppContext } from '../../../context/app'
|
||||
import { AppData } from '../../../context/data'
|
||||
import { WHITE, BLACK } from '../Stone'
|
||||
import Wobler from '../../Wobler'
|
||||
|
||||
export default function Create() {
|
||||
const ctx = Definitions()
|
||||
@ -28,18 +29,10 @@ export default function Create() {
|
||||
console.log("ctx", ctx)
|
||||
return (
|
||||
<button
|
||||
className={'game-action create'
|
||||
+ (ctx.isEnabled ? ' enabled' : ' disabled')
|
||||
+ (ctx.isFetching === true ? ' woble' : '')
|
||||
}
|
||||
className={'game-action create' + (ctx.isEnabled ? ' enabled' : ' disabled')}
|
||||
onClick={onClick}
|
||||
>
|
||||
<span>C</span>
|
||||
<span>r</span>
|
||||
<span>e</span>
|
||||
<span>a</span>
|
||||
<span>t</span>
|
||||
<span>e</span>
|
||||
<Wobler text="Leaderboard" dance={ctx.fetching} />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
@ -76,8 +69,8 @@ function Definitions() {
|
||||
hasCurrentUser,
|
||||
isEnabled,
|
||||
|
||||
isFetching: ctx.newGame.isFetching,
|
||||
setFetching: (status) => { console.log("setFetching: ", status); dispatchCtx({ update: "newGame", isFetching: status }) },
|
||||
fetching: ctx.newGame.fetching,
|
||||
setFetching: (status) => { dispatchCtx({ update: "newGame", fetching: status }) },
|
||||
|
||||
get_GameProposalRequest,
|
||||
clear_Message2Opponent: () => { dispatchCtx({ update: "newGame", message: '' }) },
|
||||
|
@ -25,7 +25,7 @@ export const initialState = {
|
||||
whitePlayer: '',
|
||||
blackPlayer: '',
|
||||
message: '',
|
||||
isFetching: false,
|
||||
fetching: false,
|
||||
},
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user