mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
This commit is contained in:
parent
8bceeb2b38
commit
e7678c979a
|
@ -13,7 +13,7 @@ function ApplicationLayout() {
|
||||||
<NavigationState>
|
<NavigationState>
|
||||||
<div className='min-w-[20rem] clr-app antialiased h-full'>
|
<div className='min-w-[20rem] clr-app antialiased h-full'>
|
||||||
<ConceptToaster
|
<ConceptToaster
|
||||||
className='mt-[4rem] text-sm' // prettier: split lines
|
className='mt-[4rem] text-[14px]' // prettier: split lines
|
||||||
autoClose={3000}
|
autoClose={3000}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
pauseOnFocusLoss={false}
|
pauseOnFocusLoss={false}
|
||||||
|
|
|
@ -36,7 +36,7 @@ function Navigation() {
|
||||||
<ToggleNavigation />
|
<ToggleNavigation />
|
||||||
<motion.div
|
<motion.div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'pl-2 pr-[0.9rem] h-[3rem] w-full', // prettier: split lines
|
'pl-2 pr-[1.5rem] sm:pr-[0.9rem] h-[3rem] w-full', // prettier: split lines
|
||||||
'flex',
|
'flex',
|
||||||
'cc-shadow-border'
|
'cc-shadow-border'
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -13,10 +13,11 @@ function ToggleNavigation() {
|
||||||
type='button'
|
type='button'
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'absolute top-0 right-0 z-navigation flex items-center justify-center',
|
'absolute top-0 right-0 z-navigation',
|
||||||
|
'min-h-[2rem] min-w-[2rem] sm:min-w-fit',
|
||||||
|
'flex items-center justify-center',
|
||||||
'clr-hover',
|
'clr-hover',
|
||||||
'select-none',
|
'select-none'
|
||||||
'min-h-[2rem]'
|
|
||||||
)}
|
)}
|
||||||
onClick={toggleNoNavigation}
|
onClick={toggleNoNavigation}
|
||||||
initial={false}
|
initial={false}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import Loader from '@/components/ui/Loader';
|
||||||
import TabLabel from '@/components/ui/TabLabel';
|
import TabLabel from '@/components/ui/TabLabel';
|
||||||
import TextURL from '@/components/ui/TextURL';
|
import TextURL from '@/components/ui/TextURL';
|
||||||
import AnimateFade from '@/components/wrap/AnimateFade';
|
import AnimateFade from '@/components/wrap/AnimateFade';
|
||||||
|
import { useAuth } from '@/context/AuthContext';
|
||||||
import { useConceptOptions } from '@/context/ConceptOptionsContext';
|
import { useConceptOptions } from '@/context/ConceptOptionsContext';
|
||||||
import { useLibrary } from '@/context/LibraryContext';
|
import { useLibrary } from '@/context/LibraryContext';
|
||||||
import { useBlockNavigation, useConceptNavigation } from '@/context/NavigationContext';
|
import { useBlockNavigation, useConceptNavigation } from '@/context/NavigationContext';
|
||||||
|
@ -34,6 +35,7 @@ function OssTabs() {
|
||||||
const router = useConceptNavigation();
|
const router = useConceptNavigation();
|
||||||
const query = useQueryStrings();
|
const query = useQueryStrings();
|
||||||
const activeTab = query.get('tab') ? (Number(query.get('tab')) as OssTabID) : OssTabID.GRAPH;
|
const activeTab = query.get('tab') ? (Number(query.get('tab')) as OssTabID) : OssTabID.GRAPH;
|
||||||
|
const { user } = useAuth();
|
||||||
|
|
||||||
const { calculateHeight, setNoFooter } = useConceptOptions();
|
const { calculateHeight, setNoFooter } = useConceptOptions();
|
||||||
const { schema, loading, loadingError: errorLoading } = useOSS();
|
const { schema, loading, loadingError: errorLoading } = useOSS();
|
||||||
|
@ -41,7 +43,12 @@ function OssTabs() {
|
||||||
|
|
||||||
const [isModified, setIsModified] = useState(false);
|
const [isModified, setIsModified] = useState(false);
|
||||||
const [selected, setSelected] = useState<OperationID[]>([]);
|
const [selected, setSelected] = useState<OperationID[]>([]);
|
||||||
useBlockNavigation(isModified);
|
useBlockNavigation(
|
||||||
|
isModified &&
|
||||||
|
schema !== undefined &&
|
||||||
|
user !== undefined &&
|
||||||
|
(user.is_staff || user.id == schema.owner || schema.editors.includes(user.id))
|
||||||
|
);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (schema) {
|
if (schema) {
|
||||||
|
|
|
@ -49,7 +49,10 @@ function ToolbarConstituenta({
|
||||||
const controller = useRSEdit();
|
const controller = useRSEdit();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Overlay position='top-1 right-4' className='cc-icons md:right-1/2 md:translate-x-1/2 transition-all duration-500'>
|
<Overlay
|
||||||
|
position='top-1 right-1/2 translate-x-1/2 sm:right-4 sm:translate-x-0 md:right-1/2 md:translate-x-1/2'
|
||||||
|
className='cc-icons outline-none transition-all duration-500'
|
||||||
|
>
|
||||||
{controller.schema && controller.schema?.oss.length > 0 ? (
|
{controller.schema && controller.schema?.oss.length > 0 ? (
|
||||||
<MiniSelectorOSS
|
<MiniSelectorOSS
|
||||||
items={controller.schema.oss}
|
items={controller.schema.oss}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user