diff --git a/.vscode/settings.json b/.vscode/settings.json
index a681c9ef..6889f44c 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -2,4 +2,4 @@
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 2
-}
\ No newline at end of file
+}
diff --git a/package.json b/package.json
index 23911e66..1cd926f6 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"build-storybook": "build-storybook",
"prettier:check": "prettier -c src",
"prettier:format": "prettier -w src",
- "lint": "eslint --max-warnings 8 src"
+ "lint": "eslint --max-warnings 11 src"
},
"dependencies": {
"@juggle/resize-observer": "^3.3.1",
diff --git a/src/Facepile.jsx b/src/Facepile.jsx
index 53b0b948..830a63d5 100644
--- a/src/Facepile.jsx
+++ b/src/Facepile.jsx
@@ -4,35 +4,63 @@ import classNames from "classnames";
import { Avatar } from "./Avatar";
import { getAvatarUrl } from "./matrix-utils";
-export function Facepile({ className, client, participants, ...rest }) {
+const overlapMap = {
+ xs: 2,
+ sm: 4,
+ md: 8,
+};
+
+const sizeMap = {
+ xs: 24,
+ sm: 32,
+ md: 36,
+};
+
+export function Facepile({
+ className,
+ client,
+ participants,
+ max,
+ size,
+ ...rest
+}) {
+ const _size = sizeMap[size];
+ const _overlap = overlapMap[size];
+
return (
member.name).join(", ")}
+ style={{ width: participants.length * (_size - _overlap) + _overlap }}
{...rest}
>
- {participants.slice(0, 3).map((member, i) => {
+ {participants.slice(0, max).map((member, i) => {
const avatarUrl = member.user?.avatarUrl;
return (
);
})}
- {participants.length > 3 && (
+ {participants.length > max && (
)}
);
}
+
+Facepile.defaultProps = {
+ max: 3,
+ size: "xs",
+};
diff --git a/src/Facepile.module.css b/src/Facepile.module.css
index 4add90ec..bc5595a2 100644
--- a/src/Facepile.module.css
+++ b/src/Facepile.module.css
@@ -1,11 +1,26 @@
.facepile {
width: 100%;
- height: 24px;
position: relative;
}
+.facepile.xs {
+ height: 24px;
+}
+
+.facepile.sm {
+ height: 32px;
+}
+
+.facepile.md {
+ height: 36px;
+}
+
.facepile .avatar {
position: absolute;
top: 0;
border: 1px solid var(--bgColor2);
}
+
+.facepile.md .avatar {
+ border-width: 2px;
+}
diff --git a/src/button/Button.jsx b/src/button/Button.jsx
index b6c3df98..1e31fde7 100644
--- a/src/button/Button.jsx
+++ b/src/button/Button.jsx
@@ -7,6 +7,8 @@ import { ReactComponent as VideoIcon } from "../icons/Video.svg";
import { ReactComponent as DisableVideoIcon } from "../icons/DisableVideo.svg";
import { ReactComponent as HangupIcon } from "../icons/Hangup.svg";
import { ReactComponent as ScreenshareIcon } from "../icons/Screenshare.svg";
+import { ReactComponent as SettingsIcon } from "../icons/Settings.svg";
+import { ReactComponent as AddUserIcon } from "../icons/AddUser.svg";
import { useButton } from "@react-aria/button";
import { mergeProps, useObjectRef } from "@react-aria/utils";
import { TooltipTrigger } from "../Tooltip";
@@ -20,6 +22,7 @@ export const variantToClassName = {
copy: [styles.copyButton],
iconCopy: [styles.iconCopyButton],
secondaryCopy: [styles.copyButton],
+ secondaryHangup: [styles.secondaryHangup],
};
export const sizeToClassName = {
@@ -126,3 +129,25 @@ export function HangupButton({ className, ...rest }) {
);
}
+
+export function SettingsButton({ className, ...rest }) {
+ return (
+
+
+ {() => "Settings"}
+
+ );
+}
+
+export function InviteButton({ className, ...rest }) {
+ return (
+
+
+ {() => "Invite"}
+
+ );
+}
diff --git a/src/button/Button.module.css b/src/button/Button.module.css
index 72450d51..5c3ec300 100644
--- a/src/button/Button.module.css
+++ b/src/button/Button.module.css
@@ -20,6 +20,7 @@ limitations under the License.
.iconButton,
.iconCopyButton,
.secondary,
+.secondaryHangup,
.copyButton {
position: relative;
display: flex;
@@ -34,6 +35,7 @@ limitations under the License.
}
.secondary,
+.secondaryHangup,
.button,
.copyButton {
padding: 7px 15px;
@@ -53,6 +55,7 @@ limitations under the License.
.iconButton:focus,
.iconCopyButton:focus,
.secondary:focus,
+.secondaryHangup:focus,
.copyButton:focus {
outline: auto;
}
@@ -119,6 +122,12 @@ limitations under the License.
background-color: transparent;
}
+.secondaryHangup {
+ color: #ff5b55;
+ border: 2px solid #ff5b55;
+ background-color: transparent;
+}
+
.copyButton.secondaryCopy {
color: var(--textColor1);
border-color: var(--textColor1);
diff --git a/src/home/RegisteredView.jsx b/src/home/RegisteredView.jsx
index 6e43f205..0480050c 100644
--- a/src/home/RegisteredView.jsx
+++ b/src/home/RegisteredView.jsx
@@ -13,22 +13,25 @@ import { JoinExistingCallModal } from "./JoinExistingCallModal";
import { useHistory } from "react-router-dom";
import { Headline, Title } from "../typography/Typography";
import { Form } from "../form/Form";
+import { useShouldShowPtt } from "../useShouldShowPtt";
export function RegisteredView({ client }) {
const [loading, setLoading] = useState(false);
const [error, setError] = useState();
const history = useHistory();
+ const shouldShowPtt = useShouldShowPtt();
const onSubmit = useCallback(
(e) => {
e.preventDefault();
const data = new FormData(e.target);
const roomName = data.get("callName");
+ const ptt = data.get("ptt") !== null;
async function submit() {
setError(undefined);
setLoading(true);
- const roomIdOrAlias = await createRoom(client, roomName);
+ const roomIdOrAlias = await createRoom(client, roomName, ptt);
if (roomIdOrAlias) {
history.push(`/room/${roomIdOrAlias}`);
@@ -87,6 +90,7 @@ export function RegisteredView({ client }) {
required
autoComplete="off"
/>
+