From bf20fb705186020ccabbcaba039f23e154872693 Mon Sep 17 00:00:00 2001 From: Celine Sarafa Date: Thu, 29 Feb 2024 13:15:59 +0100 Subject: [PATCH] chore: remove extra logic in routes --- src/routes.tsx | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/routes.tsx b/src/routes.tsx index f1b6f0a79..e3563e4e6 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -1,6 +1,4 @@ /* eslint-disable no-nested-ternary */ -import { useContext } from 'react' - import { Navigate, Route, Routes } from 'react-router-dom' import App from '@/App' @@ -11,21 +9,11 @@ import AppearanceSettings from '@/components/settings/AppearanceSettings' import NotificationsSettings from '@/components/settings/NotificationsSettings' import SettingsLayout from '@/components/settings/SettingsLayout' import SupportSettings from '@/components/settings/SupportSettings' -import W3iContext from '@/contexts/W3iContext/context' import Login from '@/pages/Login' import ScanQrCode from '@/pages/ScanQrCode' -import WidgetConnect from '@/pages/widget/Connect' -import WidgetSubscribe from '@/pages/widget/Subscribe' const ConfiguredRoutes: React.FC = () => { - const { uiEnabled } = useContext(W3iContext) - - const defaultPage = - Object.entries({ - '/messages': uiEnabled.chat, - '/notifications': uiEnabled.notify, - '/settings': uiEnabled.settings - }).find(([_, enabled]) => enabled)?.[0] ?? '/login' + const defaultPage = '/notifications' return ( @@ -34,28 +22,19 @@ const ConfiguredRoutes: React.FC = () => { } /> }> - {uiEnabled.notify ? ( }> } /> } /> - ) : null} - {uiEnabled.settings ? ( }> } /> } /> } /> - ) : null} } /> - - } /> - } /> - - } /> )