You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
1.3 KiB

package app.components.navigation;
import app.navigation.Navigation;
import com.vaadin.flow.component.html.Label;
import com.vaadin.flow.component.orderedlayout.FlexComponent;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
public class NavigationHeader extends HorizontalLayout {
private final Navigation navigation;
private final Label seasonLabel = new Label("Season:");
private final Label matchdayLabel = new Label("Matchday:");
private final Label matchLabel = new Label("Match:");
public NavigationHeader(Navigation navigation) {
this.navigation = navigation;
configureLayout();
configureChildren();
}
private void configureLayout() {
setWidthFull();
setAlignItems(FlexComponent.Alignment.CENTER);
setJustifyContentMode(FlexComponent.JustifyContentMode.END);
}
private void configureChildren() {
removeAll();
if (navigation.isSeasonEnabled()) {
add(seasonLabel, navigation.getSeasonSelect());
}
if (navigation.isMatchdayEnabled()) {
add(matchdayLabel, navigation.getMatchdaySelect());
}
if (navigation.isMatchEnabled()) {
add(matchLabel, navigation.getMatchSelect());
}
}
}