front: show action button only for onHover elemnt

This commit is contained in:
djmil 2023-10-14 11:59:05 +02:00
parent 8cac7533dd
commit b34335cefc
3 changed files with 33 additions and 0 deletions

View File

@ -19,6 +19,14 @@
color: gray; color: gray;
} }
.GameProposal .li button.action {
display: none;
}
.GameProposal .li:hover button.action {
display: initial;
}
.separator { .separator {
width: 20%; width: 20%;
/* height: 20px; */ /* height: 20px; */

View File

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import {Accept, Reject, Cancel} from './GameProposalAction';
import './GameProposal.css'; import './GameProposal.css';
const State = { const State = {
@ -22,6 +23,9 @@ const GameProposal = ({games}) => {
from {game.opponentName}, opponentColor {game.opponentColor} from {game.opponentName}, opponentColor {game.opponentColor}
<br/> <br/>
<q>{game.message}</q> <q>{game.message}</q>
<br/>
<Accept uuid={game.uuid}/>
<Reject uuid={game.uuid}/>
</p> </p>
</div> </div>
}); });
@ -34,6 +38,8 @@ const GameProposal = ({games}) => {
to {game.opponentName}, opponentColor {game.opponentColor} to {game.opponentName}, opponentColor {game.opponentColor}
<br/> <br/>
<q>{game.message}</q> <q>{game.message}</q>
<br/>
<Cancel uuid={game.uuid}/>
</p> </p>
</div> </div>
}); });

View File

@ -0,0 +1,19 @@
import React from 'react';
export function Accept({uuid}) {
return <button className="action" id={uuid} type="submit">
Accept
</button>
}
export function Reject({uuid}) {
return <button className="action" id={uuid} type="submit">
Reject
</button>
}
export function Cancel({uuid}) {
return <button className="action" id={uuid} type="submit">
Cancel
</button>
}