Skip to content

Comments

Reusable person item for samples#5217

Open
rolfsmeds wants to merge 2 commits intomainfrom
docs/person-item
Open

Reusable person item for samples#5217
rolfsmeds wants to merge 2 commits intomainfrom
docs/person-item

Conversation

@rolfsmeds
Copy link
Contributor

This PR implements a reusable "person item" (avatar+name+profession) using person-item.css and a simple dom structure, and applies it to ListBox, ContextMenu, TreeGrid, Popover, and Select samples that previously had their individual Lumo-dependent implementations.

"avatar title";
gap: 0 var(--vaadin-gap-s);
align-items: center;
line-height: 1.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking

Suggested change
line-height: 1.0;
line-height: 1;

Comment on lines +54 to +74
// HorizontalLayout userInfo = new HorizontalLayout();
// userInfo.addClassName("userMenuHeader");
// userInfo.setSpacing(false);

// Avatar userAvatar = new Avatar(name);
// userAvatar.setImage(pictureUrl);
// userAvatar.getElement().setAttribute("tabindex", "-1");
// userAvatar.addThemeVariants(AvatarVariant.LUMO_LARGE);

// VerticalLayout nameLayout = new VerticalLayout();
// nameLayout.setSpacing(false);
// nameLayout.setPadding(false);

// Div fullName = new Div(name);
// fullName.getStyle().set("font-weight", "bold");
// Div nickName = new Div("@" + person.getFirstName().toLowerCase()
// + person.getLastName().toLowerCase());
// nickName.addClassName("userMenuNickname");
// nameLayout.add(fullName, nickName);

// userInfo.add(userAvatar, nameLayout);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// HorizontalLayout userInfo = new HorizontalLayout();
// userInfo.addClassName("userMenuHeader");
// userInfo.setSpacing(false);
// Avatar userAvatar = new Avatar(name);
// userAvatar.setImage(pictureUrl);
// userAvatar.getElement().setAttribute("tabindex", "-1");
// userAvatar.addThemeVariants(AvatarVariant.LUMO_LARGE);
// VerticalLayout nameLayout = new VerticalLayout();
// nameLayout.setSpacing(false);
// nameLayout.setPadding(false);
// Div fullName = new Div(name);
// fullName.getStyle().set("font-weight", "bold");
// Div nickName = new Div("@" + person.getFirstName().toLowerCase()
// + person.getLastName().toLowerCase());
// nickName.addClassName("userMenuNickname");
// nameLayout.add(fullName, nickName);
// userInfo.add(userAvatar, nameLayout);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants