add wobler

This commit is contained in:
djmil 2023-10-31 20:33:36 +01:00
parent 66acd217e3
commit 352919581e
2 changed files with 6 additions and 13 deletions

View File

@ -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: '' }) },

View File

@ -25,7 +25,7 @@ export const initialState = {
whitePlayer: '',
blackPlayer: '',
message: '',
isFetching: false,
fetching: false,
},
}