From 363d473ce27a4d672110005f4dcde6576eb68ccc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 28 Dec 2023 14:33:51 -0800 Subject: Add support link option --- modern/src/common/attributes/useServerAttributes.js | 4 ++++ modern/src/resources/l10n/en.json | 1 + modern/src/settings/components/SettingsMenu.jsx | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/modern/src/common/attributes/useServerAttributes.js b/modern/src/common/attributes/useServerAttributes.js index e724c2b0..a985ef40 100644 --- a/modern/src/common/attributes/useServerAttributes.js +++ b/modern/src/common/attributes/useServerAttributes.js @@ -1,6 +1,10 @@ import { useMemo } from 'react'; export default (t) => useMemo(() => ({ + support: { + name: t('settingsSupport'), + type: 'string', + }, title: { name: t('serverName'), type: 'string', diff --git a/modern/src/resources/l10n/en.json b/modern/src/resources/l10n/en.json index dc34efa0..2e92ba92 100644 --- a/modern/src/resources/l10n/en.json +++ b/modern/src/resources/l10n/en.json @@ -231,6 +231,7 @@ "settingsTotpForce": "Force One-time Password", "settingsServiceWorkerUpdateInterval": "ServiceWorker Update Interval", "settingsUpdateAvailable": "There is an update available.", + "settingsSupport": "Support", "reportTitle": "Reports", "reportScheduled": "Scheduled Reports", "reportDevice": "Device", diff --git a/modern/src/settings/components/SettingsMenu.jsx b/modern/src/settings/components/SettingsMenu.jsx index 96580974..0f3ebbe5 100644 --- a/modern/src/settings/components/SettingsMenu.jsx +++ b/modern/src/settings/components/SettingsMenu.jsx @@ -13,6 +13,7 @@ import PeopleIcon from '@mui/icons-material/People'; import TodayIcon from '@mui/icons-material/Today'; import PublishIcon from '@mui/icons-material/Publish'; import SmartphoneIcon from '@mui/icons-material/Smartphone'; +import HelpIcon from '@mui/icons-material/Help'; import { Link, useLocation } from 'react-router-dom'; import { useSelector } from 'react-redux'; import { useTranslation } from '../../common/components/LocalizationProvider'; @@ -38,6 +39,7 @@ const SettingsMenu = () => { const admin = useAdministrator(); const manager = useManager(); const userId = useSelector((state) => state.session.user.id); + const supportLink = useSelector((state) => state.session.server.attributes.support); const features = useFeatures(); @@ -122,6 +124,13 @@ const SettingsMenu = () => { icon={} selected={location.pathname.startsWith('/settings/command')} /> + {supportLink && ( + } + /> + )} )} -- cgit v1.2.3