mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
Fix navigation after login
This commit is contained in:
parent
c18e34d2eb
commit
63629afede
|
@ -51,7 +51,7 @@ function SearchPanel({ total, filtered, setFilter }: SearchPanelProps) {
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
const searchFilter = new URLSearchParams(search).get('filter') as LibraryFilterStrategy | null;
|
const searchFilter = new URLSearchParams(search).get('filter') as LibraryFilterStrategy | null;
|
||||||
if (searchFilter === null) {
|
if (searchFilter === null) {
|
||||||
navigate(`/library?filter=${strategy}`);
|
navigate(`/library?filter=${strategy}`, { replace: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const inputStrategy = searchFilter && Object.values(LibraryFilterStrategy).includes(searchFilter) ? searchFilter : LibraryFilterStrategy.MANUAL;
|
const inputStrategy = searchFilter && Object.values(LibraryFilterStrategy).includes(searchFilter) ? searchFilter : LibraryFilterStrategy.MANUAL;
|
||||||
|
|
|
@ -61,10 +61,19 @@ function LoginPage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex items-center justify-center w-full select-none' style={{minHeight: mainHeight}}>
|
<div className='flex items-start justify-center w-full pt-4 select-none' style={{minHeight: mainHeight}}>
|
||||||
{ user &&
|
{ user &&
|
||||||
<div className='py-2 font-semibold'>
|
<div className='flex flex-col items-center gap-2'>
|
||||||
{`Вы вошли в систему как ${user.username}`}
|
<p className='font-semibold'>{`Вы вошли в систему как ${user.username}`}</p>
|
||||||
|
<p>
|
||||||
|
<TextURL text='Создать схему' href='/rsform-create'/>
|
||||||
|
<span> | </span>
|
||||||
|
<TextURL text='Библиотека' href='/library'/>
|
||||||
|
<span> | </span>
|
||||||
|
<TextURL text='Справка' href='/manuals'/>
|
||||||
|
<span> | </span>
|
||||||
|
<TextURL text='Выйти' href='/logout'/>
|
||||||
|
</p>
|
||||||
</div>}
|
</div>}
|
||||||
{ !user &&
|
{ !user &&
|
||||||
<Form
|
<Form
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { TabList, TabPanel, Tabs } from 'react-tabs';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import BackendError from '../../components/BackendError';
|
import BackendError from '../../components/BackendError';
|
||||||
import ConceptTab from '../../components/Common/ConceptTab';
|
|
||||||
import { ConceptLoader } from '../../components/Common/ConceptLoader';
|
import { ConceptLoader } from '../../components/Common/ConceptLoader';
|
||||||
|
import ConceptTab from '../../components/Common/ConceptTab';
|
||||||
import { useLibrary } from '../../context/LibraryContext';
|
import { useLibrary } from '../../context/LibraryContext';
|
||||||
import { useRSForm } from '../../context/RSFormContext';
|
import { useRSForm } from '../../context/RSFormContext';
|
||||||
import { useConceptTheme } from '../../context/ThemeContext';
|
import { useConceptTheme } from '../../context/ThemeContext';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user