diff --git a/examples/breakout-rooms/src/components/Avatar/Avatar.css b/examples/breakout-rooms/src/components/Avatar/Avatar.css
index 080f656fc..af0b02e43 100644
--- a/examples/breakout-rooms/src/components/Avatar/Avatar.css
+++ b/examples/breakout-rooms/src/components/Avatar/Avatar.css
@@ -1,13 +1,13 @@
.avatar {
border-radius: 100%;
flex-shrink: 0;
- background: #817f99;
+ background: var(--indigo600);
box-shadow: 0 0 0 6px var(--color, transparent);
- outline: 4px solid #fff;
+ outline: 4px solid var(--white);
width: 2.2em;
height: 2.2em;
font-size: 14px;
- color: #fff;
+ color: var(--white);
display: flex;
justify-content: center;
align-items: center;
diff --git a/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.css b/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.css
index 9cfcc545f..b590b0c02 100644
--- a/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.css
+++ b/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.css
@@ -2,36 +2,48 @@
display: flex;
height: 100%;
flex-direction: column;
- gap: 1em;
+ gap: var(--space-small);
}
.validation-messages {
- background: #f5f5f3;
- padding: 1em;
+ background: var(--indigo50);
+ border-radius: var(--border-radius-medium);
+ padding: var(--space-medium);
}
-.validation-messages .validatino-messages-title {
+.validation-messages .validation-messages-title {
font-size: 1em;
font-weight: 600;
- line-height: 1em;
+ line-height: var(--space-small);
margin: 0;
- color: #656b81;
+ color: var(--indigo600);
}
-.validation-messages .validatino-messages-items {
+.validation-messages .validation-messages-list {
font-size: 0.9em;
+ padding-left: var(--space-small);
+ margin-bottom: 0;
+}
+
+.validation-messages-item + .validation-messages-item {
+ margin-top: var(--space-xsmall);
+}
+
+.validation-messages-item::marker {
+ color: var(--indigo500);
+ padding-left: var(--space-small);
}
.toolbar {
display: flex;
flex-direction: column;
justify-content: center;
- gap: 1em;
+ gap: var(--space-small);
}
.toolbar button {
justify-content: center;
margin: 0;
width: 100%;
- padding: 1em;
+ padding: var(--space-small);
}
diff --git a/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.tsx b/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.tsx
index 1d42d9f89..b255c0661 100644
--- a/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.tsx
+++ b/examples/breakout-rooms/src/components/BreakoutManager/BreakoutManager.tsx
@@ -68,13 +68,13 @@ export const BreakoutManager: React.FC = () => {
if (frame) {
await service.setRoomTarget(selectedRoom, frame.id);
await miro.board.notifications.showInfo(
- `Frame "${frame.title}" has been selected as starting point.`,
+ `${frame.title} is set as starting point for the room`,
);
await miro.board.deselect({ id: frame.id });
setSelectedRoom(undefined);
} else {
await miro.board.notifications.showError(
- "We only support frames as starting point for now",
+ "Only frames are supported as starting point for rooms",
);
}
};
@@ -87,7 +87,7 @@ export const BreakoutManager: React.FC = () => {
const handleNudge = async (currentUser?: Json) => {
if (isUser(currentUser)) {
await miro.board.notifications.showInfo(
- `${currentUser?.name} is waiting to start the session`,
+ `${currentUser?.name} is waiting for you to start the session`,
);
}
};
@@ -111,7 +111,7 @@ export const BreakoutManager: React.FC = () => {
setSelectedRoom(selected);
await miro.board.notifications.showInfo(
- `Select the frame in the board for ${selected.name}`,
+ `Set a frame to the room by clicking on the frame title`,
);
};
@@ -183,25 +183,31 @@ export const BreakoutManager: React.FC = () => {
});
};
+ const valRooms = "Add rooms to your session";
+ const valUsers = "Add users to each room";
+ const valFrames = "Set a frame to each room";
+
const validations: string[] = [];
if (!breakout?.rooms.length) {
- validations.push("Add rooms to your session");
+ validations.push(valRooms);
+ validations.push(valUsers);
+ validations.push(valFrames);
}
const allRoomsWithParticipants = breakout?.rooms.every(
(room) => room.participants.length > 0,
);
- if (!allRoomsWithParticipants) {
- validations.push("Add users to each room");
+ if (!allRoomsWithParticipants && !validations.includes(valUsers)) {
+ validations.push(valUsers);
}
const allRoomsWithTargets = breakout?.rooms.every((room) =>
Boolean(room.targetId),
);
- if (!allRoomsWithTargets) {
- validations.push("Set a frame to each room");
+ if (!allRoomsWithTargets && !validations.includes(valFrames)) {
+ validations.push(valFrames);
}
const canStartSession = validations.length < 1;
@@ -239,12 +245,14 @@ export const BreakoutManager: React.FC = () => {
{isEditable && validations.length > 0 ? (
-
+
Before starting the session:
-
+
{validations.map((message) => (
- - {message}
+ -
+ {message}
+
))}
@@ -253,10 +261,10 @@ export const BreakoutManager: React.FC = () => {
{breakout?.state === "started" ? (
diff --git a/examples/breakout-rooms/src/components/RoomConfig/RoomConfig.css b/examples/breakout-rooms/src/components/RoomConfig/RoomConfig.css
index 2fb38c70b..40b902aff 100644
--- a/examples/breakout-rooms/src/components/RoomConfig/RoomConfig.css
+++ b/examples/breakout-rooms/src/components/RoomConfig/RoomConfig.css
@@ -2,12 +2,12 @@
display: flex;
flex-direction: column;
justify-content: center;
- background: #eeeded;
- border-radius: 0.25em;
+ background: var(--indigo50);
+ border-radius: var(--border-radius-medium);
gap: 0.5em;
- padding: 1em;
+ padding: var(--space-small);
+ padding-top: var(--space-xsmall);
width: 100%;
- height: 8em;
}
.room-controls {
@@ -43,13 +43,16 @@
.users .list {
/** Overrides DS specific tokens for dropdown **/
--space-inset-100: 16px;
- font-size: 12px;
+}
+
+.users .list .separator {
+ margin: var(--space-xsmall) var(--space-xxsmall);
}
.users .list .item {
display: flex;
align-items: center;
- gap: 1em;
+ gap: var(--space-small);
}
.users .list .item + div {
padding-left: 3.5em;
@@ -57,6 +60,7 @@
.avatars {
display: flex;
+ padding-left: var(--space-xxsmall);
}
.avatars .avatar:not(:first-child) {
diff --git a/examples/breakout-rooms/src/components/RoomConfig/RoomConfig.tsx b/examples/breakout-rooms/src/components/RoomConfig/RoomConfig.tsx
index 6ab4d318a..ca7ccb960 100644
--- a/examples/breakout-rooms/src/components/RoomConfig/RoomConfig.tsx
+++ b/examples/breakout-rooms/src/components/RoomConfig/RoomConfig.tsx
@@ -8,7 +8,7 @@ import {
IconTrash,
IconUserAdd,
} from "@mirohq/design-system";
-import { OnlineUserInfo } from "@mirohq/websdk-types";
+import { Frame, OnlineUserInfo } from "@mirohq/websdk-types";
import type { Participant, Room } from "../../types";
import { Avatar } from "../Avatar";
@@ -35,6 +35,24 @@ export const RoomConfig: React.FunctionComponent = ({
onAddParticipant,
onRemoveParticipant,
}) => {
+ const [title, setName] = React.useState("");
+ React.useEffect(() => {
+ async function FetchFrame(): Promise {
+ if (!room.targetId) {
+ return;
+ }
+ const frame = (await miro.board.getById(room.targetId)) as Frame;
+ setName(frame?.title);
+ }
+ FetchFrame();
+ }, [room.targetId]);
+
+ const renderedTitle = title ? `${title}` : "frame";
+ const dropdownSeparator = (
+
+
+
+ );
return (
@@ -42,8 +60,12 @@ export const RoomConfig: React.FunctionComponent
= ({
{room.name}
onSelectTarget(room)}
>
@@ -51,7 +73,7 @@ export const RoomConfig: React.FunctionComponent = ({
onRemove(room)}
@@ -72,7 +94,7 @@ export const RoomConfig: React.FunctionComponent = ({
@@ -88,7 +110,7 @@ export const RoomConfig: React.FunctionComponent = ({
{unassignedUsers.length ? (
- Users not in the room
+ Users not in rooms
{unassignedUsers.map((user) => (
= ({
{room.participants.length ? (
- {unassignedUsers.length ?
: null}
+ {unassignedUsers.length ? dropdownSeparator : null}
{room.participants.map((user) => (
= ({
minTime = DEFAULT_MIN_TIME,
maxTime = DEFAULT_MAX_TIME,
step = DEFAULT_STEP,
+ bigStep = BIG_STEP,
+ bigStepMaxTime = BIG_STEP_MAX_TIME,
onSet,
}) => {
const [time, setTime] = React.useState(defaultTime);
@@ -70,21 +88,27 @@ export const Timer: React.FunctionComponent = ({
setTime((time) => (time > minTime ? time - step : time));
};
+ const handleBigAdd = () => {
+ setTime((time) => (time <= bigStepMaxTime ? time + bigStep : time));
+ };
+
const handleSetTime = () => {
onSet(time);
setTimeChanged(true);
};
+ const minutes = formatTime(time) > 1 ? "minutes" : "minute";
+
return (
<>
-
+ handleSetTime()}>
- {timeChanged ? formatTime(time) : "Set timer"}
+ {timeChanged ? `${formatTime(time)} ${minutes}` : "Set timer"}
@@ -92,8 +116,8 @@ export const Timer: React.FunctionComponent = ({
handleDecrease()}
@@ -104,22 +128,24 @@ export const Timer: React.FunctionComponent = ({
{formatDisplayTime(time)}
= maxTime}
onClick={() => handleAdd()}
>
+ = bigStepMaxTime}
+ onClick={() => handleBigAdd()}
+ >
+ +5m
+
-
handleSetTime()}
- >
- Set
-
diff --git a/examples/breakout-rooms/src/components/WaitingList/WaitingList.css b/examples/breakout-rooms/src/components/WaitingList/WaitingList.css
index 1716975ae..c11123f3b 100644
--- a/examples/breakout-rooms/src/components/WaitingList/WaitingList.css
+++ b/examples/breakout-rooms/src/components/WaitingList/WaitingList.css
@@ -1,10 +1,10 @@
.waiting-list {
- border: 1px solid #d4d4d9;
- padding: 1em;
- border-radius: 0.25em;
+ border: 1px solid var(--indigo300);
+ padding: var(--space-small);
+ border-radius: var(--border-radius-medium);
display: flex;
flex-direction: column;
- gap: 1em;
+ gap: var(--space-small);
}
.waiting-list .waiting-list-title {
diff --git a/examples/breakout-rooms/src/components/WaitingList/WaitingList.tsx b/examples/breakout-rooms/src/components/WaitingList/WaitingList.tsx
index f62082f47..dfcdddfe2 100644
--- a/examples/breakout-rooms/src/components/WaitingList/WaitingList.tsx
+++ b/examples/breakout-rooms/src/components/WaitingList/WaitingList.tsx
@@ -18,7 +18,8 @@ export const WaitingList: React.FC = ({
return (
- {unassignedUsers.length} user(s) not in rooms
+ {unassignedUsers.length} {unassignedUsers.length > 1 ? "users" : "user"}{" "}
+ not in rooms
{
You facilitator is preparing the session
-
+
diff --git a/examples/breakout-rooms/src/hooks.tsx b/examples/breakout-rooms/src/hooks.tsx
index 9f523a81f..1c9fe1afd 100644
--- a/examples/breakout-rooms/src/hooks.tsx
+++ b/examples/breakout-rooms/src/hooks.tsx
@@ -112,7 +112,7 @@ export const useBreakout = () => {
if (r.id === room.id) {
const participant: Participant = {
...user,
- state: "Waiting room",
+ state: "In room",
};
const participants = [...r.participants, participant].sort((a, b) =>
a.name.localeCompare(b.name),
@@ -394,7 +394,7 @@ export const useBreakout = () => {
await session.end();
room.participants.map((participant) =>
- updateParticipant(room, participant, { state: "Waiting room" }),
+ updateParticipant(room, participant, { state: "In room" }),
);
});
diff --git a/examples/breakout-rooms/src/types.ts b/examples/breakout-rooms/src/types.ts
index 506f29d67..d870d55f1 100644
--- a/examples/breakout-rooms/src/types.ts
+++ b/examples/breakout-rooms/src/types.ts
@@ -2,10 +2,7 @@ import { Item, OnlineUserInfo, UserInfo } from "@mirohq/websdk-types";
export type BreakoutState = "idle" | "started" | "ended";
-export type ParticipantState =
- | "Waiting room"
- | "In Session"
- | "Invitation Pending";
+export type ParticipantState = "In room" | "In session" | "Invitation pending";
export type Participant = OnlineUserInfo & {
state: ParticipantState;
diff --git a/examples/breakout-rooms/src/utils.ts b/examples/breakout-rooms/src/utils.ts
index d5fb77ca0..c2da64936 100644
--- a/examples/breakout-rooms/src/utils.ts
+++ b/examples/breakout-rooms/src/utils.ts
@@ -34,7 +34,7 @@ export const formatTime = (
value: number,
unit: TimeUnit = "milliseconds",
): string => {
- const formatter = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
+ const formatter = new Intl.NumberFormat("en");
let formattedValue = value;
let formattedUnit = unit;
@@ -45,14 +45,15 @@ export const formatTime = (
formattedValue = seconds / 60;
formattedUnit = "minutes";
}
- if (formattedValue >= 60) {
- formattedValue = formattedValue / 60;
- formattedUnit = "hours";
- }
- if (formattedValue >= 24) {
- formattedValue = formattedValue / 24;
- formattedUnit = "days";
- }
+ // Commented for possible future use
+ // if (formattedValue >= 60) {
+ // formattedValue = formattedValue / 60;
+ // formattedUnit = "hours";
+ // }
+ // if (formattedValue >= 24) {
+ // formattedValue = formattedValue / 24;
+ // formattedUnit = "days";
+ // }
return formatter.format(formattedValue, formattedUnit);
};