From e2d803ebf7e6870d780f33e72332216fb8de2c05 Mon Sep 17 00:00:00 2001 From: kattoczko <50657366+kattoczko@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:15:01 +0000 Subject: [PATCH] feat: do not let users access notifications page when it's turned off (#1583) --- packages/web/src/routes.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/web/src/routes.tsx b/packages/web/src/routes.tsx index 72ff2781..edc88214 100644 --- a/packages/web/src/routes.tsx +++ b/packages/web/src/routes.tsx @@ -18,9 +18,11 @@ import * as URLS from 'config/urls'; import settingsRoutes from './settingsRoutes'; import adminSettingsRoutes from './adminSettingsRoutes'; import Notifications from 'pages/Notifications'; +import useConfig from 'hooks/useConfig'; import useAuthentication from 'hooks/useAuthentication'; function Routes() { + const { config } = useConfig(); const { isAuthenticated } = useAuthentication(); return ( @@ -119,14 +121,16 @@ function Routes() { } /> - - - - } - /> + {!config?.disableNotificationsPage && ( + + + + } + /> + )}