mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +00:00
Add preferences tab for choosing to enable timer.
This commit is contained in:
@@ -12,7 +12,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
|
|
||||||
.dialog {
|
.dialog {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
inline-size: 520px;
|
inline-size: 580px;
|
||||||
max-inline-size: 90%;
|
max-inline-size: 90%;
|
||||||
max-block-size: 600px;
|
max-block-size: 600px;
|
||||||
}
|
}
|
||||||
|
|||||||
53
src/settings/PreferencesSettingsTab.tsx
Normal file
53
src/settings/PreferencesSettingsTab.tsx
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2022-2024 New Vector Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { ChangeEvent, FC, useCallback } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Text } from "@vector-im/compound-web";
|
||||||
|
|
||||||
|
import { FieldRow, InputField } from "../input/Input";
|
||||||
|
import {
|
||||||
|
showHandRaisedTimer as showHandRaisedTimerSetting,
|
||||||
|
useSetting,
|
||||||
|
} from "./settings";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
roomId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PreferencesSettingsTab: FC<Props> = ({}) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [showHandRaisedTimer, setShowHandRaisedTimer] = useSetting(
|
||||||
|
showHandRaisedTimerSetting,
|
||||||
|
);
|
||||||
|
|
||||||
|
const onChangeSetting = useCallback(
|
||||||
|
(e: ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setShowHandRaisedTimer(e.target.checked);
|
||||||
|
},
|
||||||
|
[setShowHandRaisedTimer],
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<h4>{t("settings.preferences_tab_h4")}</h4>
|
||||||
|
<Text>{t("settings.preferences_tab_body")}</Text>
|
||||||
|
<FieldRow>
|
||||||
|
<InputField
|
||||||
|
id="showHandRaisedTimer"
|
||||||
|
label={t("settings.preferences_tab_show_hand_raised_timer_label")}
|
||||||
|
description={t(
|
||||||
|
"settings.preferences_tab_show_hand_raised_timer_description",
|
||||||
|
)}
|
||||||
|
type="checkbox"
|
||||||
|
checked={showHandRaisedTimer}
|
||||||
|
onChange={onChangeSetting}
|
||||||
|
/>
|
||||||
|
</FieldRow>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -30,11 +30,13 @@ import {
|
|||||||
useOptInAnalytics,
|
useOptInAnalytics,
|
||||||
} from "./settings";
|
} from "./settings";
|
||||||
import { isFirefox } from "../Platform";
|
import { isFirefox } from "../Platform";
|
||||||
|
import { PreferencesSettingsTab } from "./PreferencesSettingsTab";
|
||||||
|
|
||||||
type SettingsTab =
|
type SettingsTab =
|
||||||
| "audio"
|
| "audio"
|
||||||
| "video"
|
| "video"
|
||||||
| "profile"
|
| "profile"
|
||||||
|
| "preferences"
|
||||||
| "feedback"
|
| "feedback"
|
||||||
| "more"
|
| "more"
|
||||||
| "developer";
|
| "developer";
|
||||||
@@ -135,6 +137,12 @@ export const SettingsModal: FC<Props> = ({
|
|||||||
content: generateDeviceSelection(devices.videoInput, t("common.camera")),
|
content: generateDeviceSelection(devices.videoInput, t("common.camera")),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const preferencesTab: Tab<SettingsTab> = {
|
||||||
|
key: "preferences",
|
||||||
|
name: t("common.preferences"),
|
||||||
|
content: <PreferencesSettingsTab />,
|
||||||
|
};
|
||||||
|
|
||||||
const profileTab: Tab<SettingsTab> = {
|
const profileTab: Tab<SettingsTab> = {
|
||||||
key: "profile",
|
key: "profile",
|
||||||
name: t("common.profile"),
|
name: t("common.profile"),
|
||||||
@@ -234,7 +242,7 @@ export const SettingsModal: FC<Props> = ({
|
|||||||
|
|
||||||
const tabs = [audioTab, videoTab];
|
const tabs = [audioTab, videoTab];
|
||||||
if (widget === null) tabs.push(profileTab);
|
if (widget === null) tabs.push(profileTab);
|
||||||
tabs.push(feedbackTab, moreTab);
|
tabs.push(preferencesTab, feedbackTab, moreTab);
|
||||||
if (developerSettingsTab) tabs.push(developerTab);
|
if (developerSettingsTab) tabs.push(developerTab);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user