Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
haladamateusz committed Jun 27, 2024
2 parents 7be5ddd + 721eee5 commit 0747efc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions frontend/themes/apus/views/room-view.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,8 @@
right: 0;
width: 48px;
}

.room-view vaadin-icon {
height: 16px;
margin: 0 8px 3px 0;
}
21 changes: 17 additions & 4 deletions src/main/java/swiss/fihlon/apus/ui/view/RoomView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 0747efc

Please sign in to comment.