Skip to content

Commit

Permalink
Add support link option
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Dec 28, 2023
1 parent 0d7af5f commit 363d473
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modern/src/common/attributes/useServerAttributes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { useMemo } from 'react';

export default (t) => useMemo(() => ({
support: {
name: t('settingsSupport'),
type: 'string',
},
title: {
name: t('serverName'),
type: 'string',
Expand Down
1 change: 1 addition & 0 deletions modern/src/resources/l10n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions modern/src/settings/components/SettingsMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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();

Expand Down Expand Up @@ -122,6 +124,13 @@ const SettingsMenu = () => {
icon={<PublishIcon />}
selected={location.pathname.startsWith('/settings/command')}
/>
{supportLink && (
<MenuItem
title={t('settingsSupport')}
link={supportLink}
icon={<HelpIcon />}
/>
)}
</>
)}
</List>
Expand Down

0 comments on commit 363d473

Please sign in to comment.