Search in sources :

Example 1 with Avatar

use of com.vaadin.flow.component.avatar.Avatar in project flow by vaadin.

the class MainView method createHeaderContent.

private Component createHeaderContent() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.addClassName("header");
    layout.getThemeList().set("dark", true);
    layout.setWidthFull();
    layout.setSpacing(false);
    layout.setAlignItems(FlexComponent.Alignment.CENTER);
    layout.add(new DrawerToggle());
    viewTitle = new H1();
    layout.add(viewTitle);
    Avatar avatar = new Avatar();
    if (userInfo != null) {
        avatar.setName(userInfo.getFullName());
        avatar.setImage(userInfo.getImageUrl());
    }
    layout.add(avatar);
    return layout;
}
Also used : H1(com.vaadin.flow.component.html.H1) DrawerToggle(com.vaadin.flow.component.applayout.DrawerToggle) Avatar(com.vaadin.flow.component.avatar.Avatar) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Aggregations

DrawerToggle (com.vaadin.flow.component.applayout.DrawerToggle)1 Avatar (com.vaadin.flow.component.avatar.Avatar)1 H1 (com.vaadin.flow.component.html.H1)1 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)1