|
|
@ -2,7 +2,7 @@ package app.views.match.components; |
|
|
|
|
|
|
|
import app.data.entity.Game; |
|
|
|
import app.gameimage.GameImageService; |
|
|
|
import app.views.match.components.utils.GameComponentUtils; |
|
|
|
import app.views.match.components.utils.GameCardUtils; |
|
|
|
import com.vaadin.flow.component.button.Button; |
|
|
|
import com.vaadin.flow.component.html.Div; |
|
|
|
import com.vaadin.flow.component.html.Image; |
|
|
@ -13,6 +13,7 @@ import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
public class GameCard extends Div { |
|
|
|
// TODO: display reason for loss/draw |
|
|
|
|
|
|
|
private final GameImageService gameImageService; |
|
|
|
|
|
|
@ -47,12 +48,12 @@ public class GameCard extends Div { |
|
|
|
} |
|
|
|
|
|
|
|
private void defineLeft() { |
|
|
|
Label header = GameComponentUtils.getHeader(game); |
|
|
|
Div timeControlDiv = GameComponentUtils.getTimeControlDiv(game); |
|
|
|
Div blackDiv = GameComponentUtils.getPlayerDiv(game, false); |
|
|
|
Label vsLabel = GameComponentUtils.getVsLabel(); |
|
|
|
Div whiteDiv = GameComponentUtils.getPlayerDiv(game, true); |
|
|
|
Button button = GameComponentUtils.getChessComButton(game); |
|
|
|
Label header = GameCardUtils.getHeader(game); |
|
|
|
Div timeControlDiv = GameCardUtils.getTimeControlDiv(game); |
|
|
|
Div blackDiv = GameCardUtils.getPlayerDiv(game, false); |
|
|
|
Label vsLabel = GameCardUtils.getVsLabel(); |
|
|
|
Div whiteDiv = GameCardUtils.getPlayerDiv(game, true); |
|
|
|
Button button = GameCardUtils.getChessComButton(game); |
|
|
|
|
|
|
|
left.add(header, timeControlDiv, blackDiv, vsLabel, whiteDiv, button); |
|
|
|
left.addClassName("game-info-div"); |
|
|
|