use of com.vaadin.flow.component.html.Article in project komunumo-server by komunumo.
the class FaqView method toArticle.
private Component toArticle(@NotNull final FaqRecord faqRecord) {
final var article = new Article();
article.addClassName("faq-entry");
article.add(new H3(faqRecord.getQuestion()));
article.add(new Html("<div>%s</div>".formatted(faqRecord.getAnswer())));
return article;
}
use of com.vaadin.flow.component.html.Article in project komunumo-server by komunumo.
the class NewsView method toNewsItem.
private static Component toNewsItem(@NotNull final NewsEntity newsEntity) {
final var newsItem = new Article();
newsItem.addClassName("news-item");
final var createdDate = new Paragraph(formatDate(newsEntity.created().toLocalDate()));
createdDate.addClassName("created-date");
newsItem.add(createdDate);
newsItem.add(new H2(newsEntity.title()));
if (!newsEntity.subtitle().isBlank()) {
newsItem.add(new H3(newsEntity.subtitle()));
}
final var teaser = new Paragraph(new Html("<div>%s</div>".formatted(newsEntity.teaser())));
teaser.addClassName("teaser");
newsItem.add(teaser);
final var message = new Paragraph(new Html("<div>%s</div>".formatted(newsEntity.message())));
message.addClassName("message");
newsItem.add(message);
return newsItem;
}
use of com.vaadin.flow.component.html.Article in project aire-components by aire-ux.
the class Overlay method createContent.
protected Article createContent() {
val content = new Article();
content.getElement().setAttribute("slot", "content");
return content;
}