Skip to content

Commit

Permalink
added demo code and pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
samie committed May 24, 2023
1 parent ea9f82d commit bc535bb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
<artifactId>vaadin-testbench-junit5</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.vaadin.addons.nps</groupId>
<artifactId>nps</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

</dependencies>

<build>
Expand Down
5 changes: 4 additions & 1 deletion demo/src/main/java/com/example/application/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.vaadin.flow.server.PWA;

/**
* The entry point of the Spring Boot application.
*
Expand All @@ -13,7 +15,8 @@
*
*/
@SpringBootApplication
@Theme(value = "myapp")
@Theme(value = "nps")
@PWA(shortName = "Feedback", name = "Feedback")
public class Application implements AppShellConfigurator {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
import com.vaadin.flow.router.Route;
import com.vaadin.flow.theme.lumo.LumoUtility.Margin;

@PageTitle("Empty")
import org.vaadin.addons.nps.NPS;

@PageTitle("Feedback")
@Route(value = "")
public class EmptyView extends VerticalLayout {
public class FeedbackView extends VerticalLayout {

public EmptyView() {
setSpacing(false);
NPS nps = new NPS();

Image img = new Image("images/empty-plant.png", "placeholder plant");
img.setWidth("200px");
add(img);
public FeedbackView() {
setSpacing(false);

H2 header = new H2("This place intentionally left empty");
H2 header = new H2("Thank you for visiting us.");
header.addClassNames(Margin.Top.XLARGE, Margin.Bottom.MEDIUM);
add(header);
add(new Paragraph("It’s a place where you can grow your own UI 🤗"));
add(nps);

setSizeFull();
setJustifyContentMode(JustifyContentMode.CENTER);
Expand Down

0 comments on commit bc535bb

Please sign in to comment.