diff --git a/src/ui/components/SettingsView/SettingsView.tsx b/src/ui/components/SettingsView/SettingsView.tsx index 5f8041799..bb8a327c8 100644 --- a/src/ui/components/SettingsView/SettingsView.tsx +++ b/src/ui/components/SettingsView/SettingsView.tsx @@ -1,10 +1,12 @@ -import { Box, Tabs } from '@rocket.chat/fuselage'; +import { Box, IconButton, Tabs } from '@rocket.chat/fuselage'; import '@rocket.chat/fuselage-polyfills'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; +import { dispatch } from '../../../store'; import type { RootState } from '../../../store/rootReducer'; +import { DOWNLOADS_BACK_BUTTON_CLICKED } from '../../actions'; import { CertificatesTab } from './CertificatesTab'; import { GeneralTab } from './GeneralTab'; @@ -16,6 +18,20 @@ export const SettingsView = () => { const [currentTab, setCurrentTab] = useState('general'); + const isSideBarEnabled = useSelector( + ({ isSideBarEnabled }: RootState) => isSideBarEnabled + ); + + const lastSelectedServerUrl = useSelector( + ({ lastSelectedServerUrl }: RootState) => lastSelectedServerUrl + ); + + const handleBackButton = function (): void { + dispatch({ + type: DOWNLOADS_BACK_BUTTON_CLICKED, + payload: lastSelectedServerUrl, + }); + }; return ( { fontScale='h1' color='font-default' > + {!isSideBarEnabled && ( + + )} {t('settings.title')}