Skip to content

Commit 3d14c90

Browse files
committed
feat(demo): configure menuheader, logo and title
1 parent f2ef784 commit 3d14c90

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/test/java/com/flowingcode/addons/applayout/AbstractLayoutDemo.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,34 @@
2020
package com.flowingcode.addons.applayout;
2121

2222
import com.vaadin.flow.component.HasElement;
23+
import com.vaadin.flow.component.html.Div;
24+
import com.vaadin.flow.component.html.H4;
25+
import com.vaadin.flow.component.html.Image;
26+
import com.vaadin.flow.component.html.Span;
2327

2428
public class AbstractLayoutDemo extends AbstractFcAppRouterLayout {
2529

2630
@Override
2731
protected void configure(AppLayout app) {
2832
app.setMenuItems(new MenuItem("Item 1"), new MenuItem("Item 2"));
33+
34+
// menu header
35+
Div container = new Div();
36+
container.getElement().setAttribute("style", "text-align: center;");
37+
Image img = new Image("frontend/images/avatar.png", "avatar");
38+
img.getStyle().set("width", "80px");
39+
img.getStyle().set("margin-top", "20px");
40+
H4 h4 = new H4("User");
41+
container.add(img, h4);
42+
app.setMenuHeader(container);
43+
44+
// logo
45+
Image imglogo = new Image("frontend/images/applogo.png", "applogo");
46+
imglogo.setWidth("25px");
47+
app.addToTitleSection(imglogo);
48+
49+
// title
50+
app.addToTitleSection(new Div(new Span("Test Application")));
2951
}
3052

3153
@Override

0 commit comments

Comments
 (0)