diff --git a/src/main/java/app/views/match/components/MatchComponent.java b/src/main/java/app/views/match/components/MatchComponent.java index 1d52609..159e22c 100644 --- a/src/main/java/app/views/match/components/MatchComponent.java +++ b/src/main/java/app/views/match/components/MatchComponent.java @@ -37,6 +37,7 @@ public class MatchComponent extends Div implements ContentConfigurable { private final FlexLayout gamesLayout = new FlexLayout(); private final VerticalLayout noGamesLayout = new VerticalLayout(); + private final FlexLayout editLayout = new FlexLayout(); private final EditMatchCard editMatchCard; private Match match; @@ -64,6 +65,21 @@ public class MatchComponent extends Div implements ContentConfigurable { defineHeaderLayout(); defineGamesLayout(); defineNoGamesLayout(); + defineEditLayout(); + } + + private void defineHeaderLayout() { + headerLayout.add(headerPlayersLayout, headerResultLabel); + + headerPlayersLayout.addClassName("match-header-players"); + + headerResultLabel.addClassName("match-header-result"); + headerResultLabel.addClassName("bold-header"); + } + + private void defineGamesLayout() { + gamesLayout.setFlexWrap(FlexLayout.FlexWrap.WRAP); + gamesLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); } private void defineNoGamesLayout() { @@ -85,18 +101,9 @@ public class MatchComponent extends Div implements ContentConfigurable { return button; } - private void defineHeaderLayout() { - headerLayout.add(headerPlayersLayout, headerResultLabel); - - headerPlayersLayout.addClassName("match-header-players"); - - headerResultLabel.addClassName("match-header-result"); - headerResultLabel.addClassName("bold-header"); - } - - private void defineGamesLayout() { - gamesLayout.setFlexWrap(FlexLayout.FlexWrap.WRAP); - gamesLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); + private void defineEditLayout() { + editLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); + editLayout.add(editMatchCard); } ///////////// @@ -143,11 +150,11 @@ public class MatchComponent extends Div implements ContentConfigurable { private void configureMainContent() { if (navigation.editFlag()) { remove(gamesLayout); - add(editMatchCard); + add(editLayout); editMatchCard.configureContent(match); return; } - remove(editMatchCard); + remove(editLayout); configureGamesContent(); }