Merge branch 'main' into matryoshka-rageshake

This commit is contained in:
Robin Townsend 2022-10-24 13:50:45 -04:00
commit e1090377f9
7 changed files with 33 additions and 28 deletions

View file

@ -16,6 +16,8 @@ jobs:
run: "yarn install" run: "yarn install"
- name: Prettier - name: Prettier
run: "yarn run prettier:check" run: "yarn run prettier:check"
- name: i18n
run: "yarn run i18n:check"
- name: ESLint - name: ESLint
run: "yarn run lint:js" run: "yarn run lint:js"
- name: Type check - name: Type check

View file

@ -12,7 +12,8 @@
"lint": "yarn lint:types && yarn lint:js", "lint": "yarn lint:types && yarn lint:js",
"lint:js": "eslint --max-warnings 0 src", "lint:js": "eslint --max-warnings 0 src",
"lint:types": "tsc", "lint:types": "tsc",
"i18n": "node_modules/i18next-parser/bin/cli.js" "i18n": "node_modules/i18next-parser/bin/cli.js",
"i18n:check": "node_modules/i18next-parser/bin/cli.js --fail-on-warnings --fail-on-update"
}, },
"dependencies": { "dependencies": {
"@juggle/resize-observer": "^3.3.1", "@juggle/resize-observer": "^3.3.1",

View file

@ -8,6 +8,7 @@
"{{roomName}} - Walkie-talkie call": "{{roomName}} - Walkie-talkie call", "{{roomName}} - Walkie-talkie call": "{{roomName}} - Walkie-talkie call",
"<0>Already have an account?</0><1><0>Log in</0> Or <2>Access as a guest</2></1>": "<0>Already have an account?</0><1><0>Log in</0> Or <2>Access as a guest</2></1>", "<0>Already have an account?</0><1><0>Log in</0> Or <2>Access as a guest</2></1>": "<0>Already have an account?</0><1><0>Log in</0> Or <2>Access as a guest</2></1>",
"<0>Create an account</0> Or <2>Access as a guest</2>": "<0>Create an account</0> Or <2>Access as a guest</2>", "<0>Create an account</0> Or <2>Access as a guest</2>": "<0>Create an account</0> Or <2>Access as a guest</2>",
"<0>Join call now</0><1>Or</1><2>Copy call link and join later</2>": "<0>Join call now</0><1>Or</1><2>Copy call link and join later</2>",
"<0>Oops, something's gone wrong.</0><1>Submitting debug logs will help us track down the problem.</1>": "<0>Oops, something's gone wrong.</0><1>Submitting debug logs will help us track down the problem.</1>", "<0>Oops, something's gone wrong.</0><1>Submitting debug logs will help us track down the problem.</1>": "<0>Oops, something's gone wrong.</0><1>Submitting debug logs will help us track down the problem.</1>",
"<0>Why not finish by setting up a password to keep your account?</0><1>You'll be able to keep your name and set an avatar for use on future calls</1>": "<0>Why not finish by setting up a password to keep your account?</0><1>You'll be able to keep your name and set an avatar for use on future calls</1>", "<0>Why not finish by setting up a password to keep your account?</0><1>You'll be able to keep your name and set an avatar for use on future calls</1>": "<0>Why not finish by setting up a password to keep your account?</0><1>You'll be able to keep your name and set an avatar for use on future calls</1>",
"Accept camera/microphone permissions to join the call.": "Accept camera/microphone permissions to join the call.", "Accept camera/microphone permissions to join the call.": "Accept camera/microphone permissions to join the call.",
@ -28,7 +29,6 @@
"Connection lost": "Connection lost", "Connection lost": "Connection lost",
"Copied!": "Copied!", "Copied!": "Copied!",
"Copy and share this call link": "Copy and share this call link", "Copy and share this call link": "Copy and share this call link",
"Copy call link and join later": "Copy call link and join later",
"Create account": "Create account", "Create account": "Create account",
"Debug log": "Debug log", "Debug log": "Debug log",
"Debug log request": "Debug log request", "Debug log request": "Debug log request",

View file

@ -72,12 +72,12 @@ export function Facepile({
{...rest} {...rest}
> >
{participants.slice(0, max).map((member, i) => { {participants.slice(0, max).map((member, i) => {
const avatarUrl = member.user?.avatarUrl; const avatarUrl = member.getMxcAvatarUrl();
return ( return (
<Avatar <Avatar
key={member.userId} key={member.userId}
size={size} size={size}
src={avatarUrl} src={avatarUrl ?? undefined}
fallback={member.name.slice(0, 1).toUpperCase()} fallback={member.name.slice(0, 1).toUpperCase()}
className={styles.avatar} className={styles.avatar}
style={{ left: i * (_size - _overlap) }} style={{ left: i * (_size - _overlap) }}

View file

@ -237,14 +237,14 @@ export function InCallView({
const renderAvatar = useCallback( const renderAvatar = useCallback(
(roomMember: RoomMember, width: number, height: number) => { (roomMember: RoomMember, width: number, height: number) => {
const avatarUrl = roomMember.user?.avatarUrl; const avatarUrl = roomMember.getMxcAvatarUrl();
const size = Math.round(Math.min(width, height) / 2); const size = Math.round(Math.min(width, height) / 2);
return ( return (
<Avatar <Avatar
key={roomMember.userId} key={roomMember.userId}
size={size} size={size}
src={avatarUrl} src={avatarUrl ?? undefined}
fallback={roomMember.name.slice(0, 1).toUpperCase()} fallback={roomMember.name.slice(0, 1).toUpperCase()}
className={styles.avatar} className={styles.avatar}
/> />

View file

@ -19,7 +19,7 @@ import { GroupCall, GroupCallState } from "matrix-js-sdk/src/webrtc/groupCall";
import { MatrixClient } from "matrix-js-sdk/src/client"; import { MatrixClient } from "matrix-js-sdk/src/client";
import { PressEvent } from "@react-types/shared"; import { PressEvent } from "@react-types/shared";
import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed";
import { useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import styles from "./LobbyView.module.css"; import styles from "./LobbyView.module.css";
import { Button, CopyButton } from "../button"; import { Button, CopyButton } from "../button";
@ -130,6 +130,7 @@ export function LobbyView({
audioOutput={audioOutput} audioOutput={audioOutput}
/> />
)} )}
<Trans>
<Button <Button
ref={joinCallButtonRef} ref={joinCallButtonRef}
className={styles.copyButton} className={styles.copyButton}
@ -146,8 +147,9 @@ export function LobbyView({
className={styles.copyButton} className={styles.copyButton}
copiedMessage={t("Call link copied")} copiedMessage={t("Call link copied")}
> >
{t("Copy call link and join later")} Copy call link and join later
</CopyButton> </CopyButton>
</Trans>
</div> </div>
{!isEmbedded && ( {!isEmbedded && (
<Body className={styles.joinRoomFooter}> <Body className={styles.joinRoomFooter}>

View file

@ -120,7 +120,7 @@ function getTilePositions(
layout: Layout layout: Layout
): TilePosition[] { ): TilePosition[] {
if (layout === "freedom") { if (layout === "freedom") {
if (tileCount === 2 && !hasPresenter) { if (tileCount === 2 && !hasPresenter && focusedTileCount === 0) {
return getOneOnOneLayoutTilePositions( return getOneOnOneLayoutTilePositions(
gridWidth, gridWidth,
gridHeight, gridHeight,
@ -657,7 +657,7 @@ function reorderTiles(tiles: Tile[], layout: Layout) {
if ( if (
layout === "freedom" && layout === "freedom" &&
tiles.length === 2 && tiles.length === 2 &&
!tiles.some((t) => t.presenter) !tiles.some((t) => t.presenter || t.focused)
) { ) {
// 1:1 layout // 1:1 layout
tiles.forEach((tile) => (tile.order = tile.item.isLocal ? 0 : 1)); tiles.forEach((tile) => (tile.order = tile.item.isLocal ? 0 : 1));
@ -999,7 +999,7 @@ export function VideoGrid({
let newTiles = tiles; let newTiles = tiles;
if (tiles.length === 2 && !tiles.some((t) => t.presenter)) { if (tiles.length === 2 && !tiles.some((t) => t.presenter || t.focused)) {
// We're in 1:1 mode, so only the local tile should be draggable // We're in 1:1 mode, so only the local tile should be draggable
if (!dragTile.item.isLocal) return; if (!dragTile.item.isLocal) return;