Fix scroll position

This commit is contained in:
IRBorisov 2023-08-03 17:34:55 +03:00
parent 0c53bf7a30
commit 6394396bee
4 changed files with 9 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import { Route, Routes } from 'react-router-dom';
import Footer from './components/Footer'; import Footer from './components/Footer';
import Navigation from './components/Navigation/Navigation'; import Navigation from './components/Navigation/Navigation';
import ToasterThemed from './components/ToasterThemed'; import ToasterThemed from './components/ToasterThemed';
import { useConceptTheme } from './context/ThemeContext';
import CreateRSFormPage from './pages/CreateRSFormPage'; import CreateRSFormPage from './pages/CreateRSFormPage';
import HomePage from './pages/HomePage'; import HomePage from './pages/HomePage';
import LibraryPage from './pages/LibraryPage'; import LibraryPage from './pages/LibraryPage';
@ -15,6 +16,8 @@ import RSFormPage from './pages/RSFormPage';
import UserProfilePage from './pages/UserProfilePage'; import UserProfilePage from './pages/UserProfilePage';
function App () { function App () {
const { noNavigation } = useConceptTheme();
return ( return (
<div className='antialiased clr-app'> <div className='antialiased clr-app'>
<Navigation /> <Navigation />
@ -24,7 +27,8 @@ function App () {
draggable={false} draggable={false}
pauseOnFocusLoss={false} pauseOnFocusLoss={false}
/> />
<main className='min-h-[calc(100vh-7.5rem)] px-2 h-fit'> <div className={`max-h-[calc(100vh-${noNavigation ? 0 : 4.5}rem)] overflow-auto`}>
<main className={`min-h-[calc(100vh-${noNavigation ? 8 : 12}rem)] px-2`}>
<Routes> <Routes>
<Route path='/' element={ <HomePage/>} /> <Route path='/' element={ <HomePage/>} />
@ -42,6 +46,7 @@ function App () {
</Routes> </Routes>
</main> </main>
<Footer /> <Footer />
</div>
</div> </div>
); );
} }

View File

@ -18,7 +18,7 @@ function Navigation () {
const navigateHelp = () => { navigate('/manuals') }; const navigateHelp = () => { navigate('/manuals') };
return ( return (
<nav className='sticky top-0 left-0 right-0 z-50'> <nav className='sticky top-0 left-0 right-0 z-50 h-fit'>
{!noNavigation && {!noNavigation &&
<button <button
title='Скрыть навигацию' title='Скрыть навигацию'

View File

@ -249,7 +249,7 @@ function EditorItems({ onOpenEdit, onCreateCst, onDeleteCst }: EditorItemsProps)
<div className='w-full'> <div className='w-full'>
<div <div
className={'flex justify-start w-full gap-1 px-2 py-1 border-y items-center h-[2.2rem] clr-app' + className={'flex justify-start w-full gap-1 px-2 py-1 border-y items-center h-[2.2rem] clr-app' +
(!noNavigation ? ' sticky z-10 top-[4rem]' : ' sticky z-10 top-[0rem]')} (!noNavigation ? ' sticky z-10 top-[0rem]' : ' sticky z-10 top-[0rem]')}
> >
<div className='mr-3 whitespace-nowrap'> <div className='mr-3 whitespace-nowrap'>
Выбраны Выбраны

View File

@ -127,7 +127,7 @@ function EditorTermGraph() {
</div> </div>
</div> </div>
<div className='flex-wrap w-full h-full overflow-auto'> <div className='flex-wrap w-full h-full overflow-auto'>
<div className='relative w-[1240px] h-[800px] 2xl:w-[1880px] 2xl:h-[800px]'> <div className='relative w-[1240px] h-[730px] 2xl:w-[1880px] 2xl:h-[750px]'>
<GraphCanvas <GraphCanvas
draggable draggable
ref={graphRef} ref={graphRef}