Better GemeAction Panel (#22)

Reviewed-on: http://192.168.8.55:3000/HQLAx/CordaCheckers/pulls/22
This commit is contained in:
djmil 2023-11-01 11:30:03 +01:00
parent c999302cda
commit 3a2c9e93e2
11 changed files with 22 additions and 23 deletions

View File

@ -1,4 +1,4 @@
.action-panel { .game-action {
margin-bottom: 10px; margin-bottom: 10px;
/* background-color: lightgrey; */ /* background-color: lightgrey; */
width: 100%; width: 100%;
@ -6,13 +6,12 @@
padding-bottom: 8px; */ padding-bottom: 8px; */
color: black; color: black;
padding-left: -10px; padding-left: -10px;
/* */
margin-left: 10px; margin-left: 10px;
border: 0.5px dotted lightslategray; border: 0.5px dotted lightslategray;
} }
.game-action { .game-action > button {
width:fit-content; width:fit-content;
padding: 8px; padding: 8px;
padding-left: 15px; padding-left: 15px;
@ -22,34 +21,34 @@
margin: 2px; margin: 2px;
} }
.game-action.create:hover, /* OR */ .game-action > .create:hover, /* OR */
.game-action.busy .game-action > .busy
{ {
background-color:#00b0ff60; background-color:#00b0ff60;
} }
.game-action.create.enabled:active { .game-action > .create.enabled:active {
background-color:#00b0ffa0; background-color:#00b0ffa0;
} }
.game-action.cancel:hover, .game-action > .cancel:hover,
.game-action.reject:hover { .game-action > .reject:hover {
background-color:#ff000030 background-color:#ff000030
} }
.game-action.cancel:active, .game-action > .cancel:active,
.game-action.reject:active { .game-action > .reject:active {
background-color:#ff000080 background-color:#ff000080
} }
.game-action.accept:hover { .game-action > .accept:hover {
background-color: #00af0030; background-color: #00af0030;
} }
.game-action.accept:active { .game-action > .accept:active {
background-color:#00af0080; background-color:#00af0080;
} }
.game-action.disabled { .game-action > .disabled {
color: gray; color: gray;
} }

View File

@ -27,7 +27,7 @@ export default function GameAction() {
const isArchivePath = matchPath("/game/archive/*", pathname); const isArchivePath = matchPath("/game/archive/*", pathname);
return ( return (
<div className='action-panel'> <div className='game-action'>
{isNewGamePath && <Create />} {isNewGamePath && <Create />}
{isProposalPath && <Reject />} {isProposalPath && <Reject />}

View File

@ -2,5 +2,5 @@ import React from 'react';
export default function Accept() { export default function Accept() {
return <button className='game-action accept'>Accept</button> return <button className='accept'>Accept</button>
} }

View File

@ -2,5 +2,5 @@ import React from 'react';
export default function Backward() { export default function Backward() {
return <button className='game-action backward'>Backward</button> return <button className='backward'>Backward</button>
} }

View File

@ -2,5 +2,5 @@ import React from 'react';
export default function Cancel() { export default function Cancel() {
return <button className='game-action cancel'>Cancel</button> return <button className='cancel'>Cancel</button>
} }

View File

@ -31,7 +31,7 @@ export default function Create() {
return ( return (
<button <button
className={'game-action create' className={'create'
+ (ctx.enabled ? ' enabled' : ' disabled') + (ctx.enabled ? ' enabled' : ' disabled')
+ (ctx.fetching ? ' busy' : '') + (ctx.fetching ? ' busy' : '')
} }

View File

@ -2,5 +2,5 @@ import React from 'react';
export default function DrawAcq() { export default function DrawAcq() {
return <button className='game-action draw-acq'>Draw acquire</button> return <button className='draw-acq'>Draw acquire</button>
} }

View File

@ -2,5 +2,5 @@ import React from 'react';
export default function DrawReq() { export default function DrawReq() {
return <button className='game-action drawreq'>Draw request</button> return <button className='drawreq'>Draw request</button>
} }

View File

@ -2,5 +2,5 @@ import React from 'react';
export default function Forward() { export default function Forward() {
return <button className='game-action forward'>Forward</button> return <button className='forward'>Forward</button>
} }

View File

@ -2,5 +2,5 @@ import React from 'react';
export default function Reject() { export default function Reject() {
return <button className='game-action reject'>Reject</button> return <button className='reject'>Reject</button>
} }

View File

@ -2,5 +2,5 @@ import React from 'react';
export default function Surrender() { export default function Surrender() {
return <button className='game-action surrender'>Surrender</button> return <button className='surrender'>Surrender</button>
} }