front: PlayerComponent
- color - name TBD: - setName - nameList
This commit is contained in:
parent
4421ca5445
commit
a658827cb3
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
.selectable i {
|
.selectable i {
|
||||||
font-size: 70%;
|
font-size: 70%;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* .Games .li button.action {
|
/* .Games .li button.action {
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
import './Selectable.css'
|
import './Selectable.css'
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Stone, oppositeColor } from '../Stone';
|
import { oppositeColor } from '../Stone';
|
||||||
|
import Player from '../Player';
|
||||||
|
|
||||||
export default function Selectable({game}) {
|
export default function Selectable({game}) {
|
||||||
|
|
||||||
|
const myColor = game.myColor
|
||||||
|
|
||||||
|
const opponentColor = oppositeColor(myColor)
|
||||||
|
const opponentName = game.opponentName
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='selectable' key={game.uuid}>
|
<div className='selectable' key={game.uuid}>
|
||||||
<div className='tiltle'>
|
<div className='tiltle'>
|
||||||
{Stone(game.myColor)}
|
<Player color={myColor}/>
|
||||||
<i>vs</i>
|
<i>vs</i>
|
||||||
{Stone(oppositeColor(game.myColor))}
|
<Player color={opponentColor} name={opponentName}/>
|
||||||
{game.opponentName}
|
|
||||||
</div>
|
</div>
|
||||||
<q>{game.message}</q>
|
<q>{game.message}</q>
|
||||||
</div>
|
</div>
|
||||||
|
0
webapp/src/components/Game/Player.css
Normal file
0
webapp/src/components/Game/Player.css
Normal file
13
webapp/src/components/Game/Player.jsx
Normal file
13
webapp/src/components/Game/Player.jsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import './Player.css'
|
||||||
|
import React from 'react'
|
||||||
|
import { Stone } from './Stone'
|
||||||
|
|
||||||
|
export default function Player({ color, name }) {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span className='player'>
|
||||||
|
<Stone color={color} />
|
||||||
|
{name}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import './Stone.css';
|
import './Stone.css'
|
||||||
import React from 'react';
|
import React from 'react'
|
||||||
|
|
||||||
export function Stone( color ) {
|
export function Stone({ color }) {
|
||||||
switch (color) {
|
switch (color) {
|
||||||
case WHITE():
|
case WHITE():
|
||||||
return WhiteStone()
|
return WhiteStone()
|
||||||
|
Loading…
Reference in New Issue
Block a user