Search in sources :

Example 26 with H2

use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.

the class NewsletterSubscriptionValidationView method setParameter.

@Override
public void setParameter(@NotNull final BeforeEvent beforeEvent, @Nullable @OptionalParameter final String parameter) {
    final var location = beforeEvent.getLocation();
    final var queryParameters = location.getQueryParameters();
    final var parameters = queryParameters.getParameters();
    final var emailAddress = parameters.getOrDefault("email", List.of("")).get(0);
    final var validationCode = parameters.getOrDefault("code", List.of("")).get(0);
    final var validationOkay = databaseService.validateSubscription(emailAddress, validationCode);
    final var content = new Div();
    content.add(new H2("Newsletter Subscription Validation"));
    content.add(new Html(validationOkay ? "<p class=\"successful\">You successfully subscribed to our newsletter.</p>" : "<p class=\"failed\">Your subscription was not successful.<br/>Check the link in the email you received shortly.</p>"));
    content.add(new RouterLink("Back to home page", HomeView.class));
    setContent(content);
}
Also used : Div(com.vaadin.flow.component.html.Div) RouterLink(com.vaadin.flow.router.RouterLink) HomeView(org.komunumo.ui.view.website.home.HomeView) Html(com.vaadin.flow.component.Html) H2(com.vaadin.flow.component.html.H2)

Example 27 with H2

use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.

the class EventArticle method addTitle.

/**
 * Add the event title.
 * @param event the event
 */
protected void addTitle(@NotNull final Event event) {
    final var detailLink = event.getCompleteEventUrl();
    add(new Anchor(detailLink, new H2(event.getTitle())));
    if (!event.getSubtitle().isBlank()) {
        add(new Anchor(detailLink, new H3(event.getSubtitle())));
    }
}
Also used : Anchor(com.vaadin.flow.component.html.Anchor) H2(com.vaadin.flow.component.html.H2) H3(com.vaadin.flow.component.html.H3)

Example 28 with H2

use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.

the class WebsiteFooter method createAbout.

private Component createAbout() {
    final var layout = new HorizontalLayout();
    layout.setId("website-footer-about");
    final var title = new Div(new H2("About"));
    final var about = new Html("<div>%s</div>".formatted(configuration.getWebsiteAboutText()));
    layout.add(new HorizontalLayout(title, about));
    return layout;
}
Also used : Div(com.vaadin.flow.component.html.Div) Html(com.vaadin.flow.component.Html) H2(com.vaadin.flow.component.html.H2) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout)

Example 29 with H2

use of com.vaadin.flow.component.html.H2 in project sapl-demos by heutelbeck.

the class MainLayout method createDrawerContent.

private Component createDrawerContent() {
    H2 appName = new H2("SAPL Vaadin Demo");
    appName.addClassNames("flex", "items-center", "h-xl", "m-0", "px-m", "text-m");
    com.vaadin.flow.component.html.Section section = new com.vaadin.flow.component.html.Section(appName, createNavigation(), createFooter());
    section.addClassNames("flex", "flex-col", "items-stretch", "max-h-full", "min-h-full");
    return section;
}
Also used : H2(com.vaadin.flow.component.html.H2)

Example 30 with H2

use of com.vaadin.flow.component.html.H2 in project komunumo-server by komunumo.

the class EventsView method beforeEnter.

@Override
public void beforeEnter(@NotNull final BeforeEnterEvent beforeEnterEvent) {
    final var params = beforeEnterEvent.getRouteParameters();
    final var location = params.get("location");
    final var events = databaseService.upcomingEvents().toList();
    final var subMenu = createSubMenu(events, location.orElse(null));
    final var eventsList = new Div();
    eventsList.addClassName("events-list");
    final var filteredEventPreviews = events.stream().filter(event -> location.isEmpty() || URLUtil.createReadableUrl(event.getLocation()).equals(location.get())).map(EventPreview::new).toList();
    if (filteredEventPreviews.isEmpty()) {
        eventsList.add(new H2("No upcoming events found"));
        eventsList.add(new H3("Please try a different location from the menu to the left."));
    } else {
        eventsList.add(filteredEventPreviews.toArray(new EventPreview[0]));
    }
    setSubMenu(subMenu);
    setContent(eventsList);
}
Also used : Div(com.vaadin.flow.component.html.Div) H2(com.vaadin.flow.component.html.H2) H3(com.vaadin.flow.component.html.H3)

Aggregations

H2 (com.vaadin.flow.component.html.H2)68 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)29 Div (com.vaadin.flow.component.html.Div)25 Grid (com.vaadin.flow.component.grid.Grid)11 ComboBox (com.vaadin.flow.component.combobox.ComboBox)10 Button (com.vaadin.flow.component.button.Button)8 Paragraph (com.vaadin.flow.component.html.Paragraph)7 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)7 Route (com.vaadin.flow.router.Route)6 List (java.util.List)6 IntStream (java.util.stream.IntStream)6 NativeButton (com.vaadin.flow.component.html.NativeButton)5 ArrayList (java.util.ArrayList)5 Html (com.vaadin.flow.component.Html)4 TextField (com.vaadin.flow.component.textfield.TextField)4 Faker (com.github.javafaker.Faker)3 ItemFilter (com.vaadin.flow.component.combobox.ComboBox.ItemFilter)3 Label (com.vaadin.flow.component.html.Label)3 CallbackDataProvider (com.vaadin.flow.data.provider.CallbackDataProvider)3 ComponentRenderer (com.vaadin.flow.data.renderer.ComponentRenderer)3