Search in sources :

Example 1 with Article

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;
}
Also used : Article(com.vaadin.flow.component.html.Article) Html(com.vaadin.flow.component.Html) H3(com.vaadin.flow.component.html.H3)

Example 2 with 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;
}
Also used : Article(com.vaadin.flow.component.html.Article) Html(com.vaadin.flow.component.Html) H2(com.vaadin.flow.component.html.H2) H3(com.vaadin.flow.component.html.H3) Paragraph(com.vaadin.flow.component.html.Paragraph)

Example 3 with Article

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;
}
Also used : lombok.val(lombok.val) Article(com.vaadin.flow.component.html.Article)

Aggregations

Article (com.vaadin.flow.component.html.Article)3 Html (com.vaadin.flow.component.Html)2 H3 (com.vaadin.flow.component.html.H3)2 H2 (com.vaadin.flow.component.html.H2)1 Paragraph (com.vaadin.flow.component.html.Paragraph)1 lombok.val (lombok.val)1