From 721eee5971c553b1356a83ac44e8a6d66035c68c Mon Sep 17 00:00:00 2001 From: Marcus Fihlon Date: Thu, 27 Jun 2024 20:31:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Replace=20emojis=20with=20icons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcus Fihlon --- frontend/themes/apus/views/room-view.css | 5 +++++ .../swiss/fihlon/apus/ui/view/RoomView.java | 21 +++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/frontend/themes/apus/views/room-view.css b/frontend/themes/apus/views/room-view.css index 564716e..f4e4f02 100644 --- a/frontend/themes/apus/views/room-view.css +++ b/frontend/themes/apus/views/room-view.css @@ -73,3 +73,8 @@ right: 0; width: 48px; } + +.room-view vaadin-icon { + height: 16px; + margin: 0 8px 3px 0; +} diff --git a/src/main/java/swiss/fihlon/apus/ui/view/RoomView.java b/src/main/java/swiss/fihlon/apus/ui/view/RoomView.java index 922bac8..89634e0 100644 --- a/src/main/java/swiss/fihlon/apus/ui/view/RoomView.java +++ b/src/main/java/swiss/fihlon/apus/ui/view/RoomView.java @@ -24,6 +24,8 @@ import com.vaadin.flow.component.html.Div; import com.vaadin.flow.component.html.H3; import com.vaadin.flow.component.html.Image; +import com.vaadin.flow.component.icon.Icon; +import com.vaadin.flow.component.icon.VaadinIcon; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import swiss.fihlon.apus.event.Language; @@ -115,14 +117,20 @@ private Component createSpeakersComponent() { final var joinedSpeakers = speakers.stream() .map(Speaker::fullName) .collect(Collectors.joining(", ")); - speakersComponent.add(new Text(String.format("\uD83D\uDC64 %s", joinedSpeakers))); + speakersComponent.add( + new Icon(VaadinIcon.USER), + new Text(joinedSpeakers) + ); } return speakersComponent; } @NotNull private Component createRoomComponent() { - return new Div(new Text(String.format("\uD83D\uDCCD %s", room.name()))); + return new Div( + new Icon(VaadinIcon.ARROW_CIRCLE_RIGHT), + new Text(room.name()) + ); } @NotNull @@ -135,12 +143,17 @@ private Component createTimeComponent() { } else if (startTime.isBefore(now) && endTime.isAfter(now)) { // running session final Duration duration = Duration.between(now, endTime); final long timeLeft = Math.round(duration.getSeconds() / 60f); - timeComponent.add(new Text("⌛ " + getTranslation(timeLeft == 1 + timeComponent.add( + new Icon(VaadinIcon.HOURGLASS), + new Text(getTranslation(timeLeft == 1 ? "event.session.countdown.singular" : "event.session.countdown.plural", timeLeft))); roomStyle = RoomStyle.RUNNING; } else { // next session - timeComponent.add(new Text(String.format("⌚ %s - %s", startTime, endTime))); + timeComponent.add( + new Icon(VaadinIcon.ALARM), + new Text(String.format("%s - %s", startTime, endTime)) + ); roomStyle = RoomStyle.NEXT; } return timeComponent;