mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-27 00:48:06 +08:00
Add preferences tab for choosing to enable timer.
This commit is contained in:
parent
dbabf45ca7
commit
e1a4310e29
@ -12,7 +12,7 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
.dialog {
|
||||
box-sizing: border-box;
|
||||
inline-size: 520px;
|
||||
inline-size: 580px;
|
||||
max-inline-size: 90%;
|
||||
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,
|
||||
} from "./settings";
|
||||
import { isFirefox } from "../Platform";
|
||||
import { PreferencesSettingsTab } from "./PreferencesSettingsTab";
|
||||
|
||||
type SettingsTab =
|
||||
| "audio"
|
||||
| "video"
|
||||
| "profile"
|
||||
| "preferences"
|
||||
| "feedback"
|
||||
| "more"
|
||||
| "developer";
|
||||
@ -135,6 +137,12 @@ export const SettingsModal: FC<Props> = ({
|
||||
content: generateDeviceSelection(devices.videoInput, t("common.camera")),
|
||||
};
|
||||
|
||||
const preferencesTab: Tab<SettingsTab> = {
|
||||
key: "preferences",
|
||||
name: t("common.preferences"),
|
||||
content: <PreferencesSettingsTab />,
|
||||
};
|
||||
|
||||
const profileTab: Tab<SettingsTab> = {
|
||||
key: "profile",
|
||||
name: t("common.profile"),
|
||||
@ -234,7 +242,7 @@ export const SettingsModal: FC<Props> = ({
|
||||
|
||||
const tabs = [audioTab, videoTab];
|
||||
if (widget === null) tabs.push(profileTab);
|
||||
tabs.push(feedbackTab, moreTab);
|
||||
tabs.push(preferencesTab, feedbackTab, moreTab);
|
||||
if (developerSettingsTab) tabs.push(developerTab);
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user