);
-}
+};
diff --git a/src/auth/generateRandomName.js b/src/auth/generateRandomName.ts
similarity index 97%
rename from src/auth/generateRandomName.js
rename to src/auth/generateRandomName.ts
index bcd9d0ae..b58c1114 100644
--- a/src/auth/generateRandomName.js
+++ b/src/auth/generateRandomName.ts
@@ -19,6 +19,7 @@ import {
adjectives,
colors,
animals,
+ Config,
} from "unique-names-generator";
const elements = [
@@ -142,7 +143,7 @@ const elements = [
"oganesson",
];
-export function generateRandomName(config) {
+export function generateRandomName(config: Config): string {
return uniqueNamesGenerator({
dictionaries: [colors, adjectives, animals, elements],
style: "lowerCase",
diff --git a/src/room/PTTButton.jsx b/src/room/PTTButton.tsx
similarity index 85%
rename from src/room/PTTButton.jsx
rename to src/room/PTTButton.tsx
index 8448f96a..10f45edd 100644
--- a/src/room/PTTButton.jsx
+++ b/src/room/PTTButton.tsx
@@ -16,11 +16,23 @@ limitations under the License.
import React, { useCallback, useEffect, useState } from "react";
import classNames from "classnames";
+
import styles from "./PTTButton.module.css";
import { ReactComponent as MicIcon } from "../icons/Mic.svg";
import { Avatar } from "../Avatar";
-export function PTTButton({
+interface Props {
+ showTalkOverError: boolean;
+ activeSpeakerUserId: string;
+ activeSpeakerDisplayName: string;
+ activeSpeakerAvatarUrl: string;
+ activeSpeakerIsLocalUser: boolean;
+ size: number;
+ startTalking: () => void;
+ stopTalking: () => void;
+}
+
+export const PTTButton: React.FC
= ({
showTalkOverError,
activeSpeakerUserId,
activeSpeakerDisplayName,
@@ -29,17 +41,17 @@ export function PTTButton({
size,
startTalking,
stopTalking,
-}) {
+}) => {
const [isHeld, setHeld] = useState(false);
const onDocumentMouseUp = useCallback(() => {
if (isHeld) stopTalking();
setHeld(false);
- }, [isHeld, setHeld]);
+ }, [isHeld, setHeld, stopTalking]);
const onButtonMouseDown = useCallback(() => {
setHeld(true);
startTalking();
- }, [setHeld]);
+ }, [setHeld, startTalking]);
useEffect(() => {
window.addEventListener("mouseup", onDocumentMouseUp);
@@ -48,7 +60,6 @@ export function PTTButton({
window.removeEventListener("mouseup", onDocumentMouseUp);
};
}, [onDocumentMouseUp]);
-
return (