diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 781898a..d9c51ef 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -1,5 +1,5 @@ 'use client'; -import { FC, useMemo } from 'react'; +import { FC, useEffect, useMemo, useState } from 'react'; import { HeaderLayout } from '@/layouts/HeaderLayout'; import { Props } from './Header.props'; import style from './Header.module.css'; @@ -18,10 +18,17 @@ import { useLogout } from '@/hooks/auth/useLogout'; export const Header: FC = ({ activePath, className, ...props }) => { const activeNextPathName = usePathname(); + const [isNavigating, setIsNavigating] = useState(false); + activePath = activePath === undefined ? activeNextPathName : activePath; const { data: userData } = useGetUserMe(); const { logout } = useLogout(); + useEffect(() => { + // как только роут сменился — считаем, что навигация завершена + setIsNavigating(false); + }, [activeNextPathName]); + const visibleLinks = useMemo(() => { const isAdmin = userData?.role === Role.Admin; return Links.filter((link) => { @@ -49,6 +56,13 @@ export const Header: FC = ({ activePath, className, ...props }) => { { + if (activePath === link.direction || isNavigating) { + event.preventDefault(); + return; + } + setIsNavigating(true); + }} className={cn( style.link, activePath === link.direction ? style.linkActive : style.linkHover, diff --git a/src/components/ScriptsPanel/components/ScriptElement/index.tsx b/src/components/ScriptsPanel/components/ScriptElement/index.tsx index 761b0e9..e660e73 100644 --- a/src/components/ScriptsPanel/components/ScriptElement/index.tsx +++ b/src/components/ScriptsPanel/components/ScriptElement/index.tsx @@ -84,10 +84,7 @@ export const ScriptElement: FC = ({ href={`/script/${id}`} className={cn(className, styles.scriptElement, basicStyles.layout)} {...props}> -
-

{name}

-
- +

{name}

{desc || ''}

} className={styles.scriptElement__author}> diff --git a/src/layouts/PipelineModalLayout/PipelineModalLayout.module.css b/src/layouts/PipelineModalLayout/PipelineModalLayout.module.css index a20f05f..a65806a 100644 --- a/src/layouts/PipelineModalLayout/PipelineModalLayout.module.css +++ b/src/layouts/PipelineModalLayout/PipelineModalLayout.module.css @@ -13,6 +13,7 @@ z-index: 11; overflow-y: auto; max-height: 80%; + max-width: 70%; scrollbar-color: var(--color-gray-light2) transparent; scrollbar-width: thin; @@ -212,13 +213,14 @@ padding: 1rem; background: var(--color-white-main); border: 1px solid var(--color-gray-border); - white-space: pre-line; + white-space: pre; font-family: Consolas, monospace; font-weight: 400; font-size: 0.875rem; line-height: 1.25rem; color: var(--color-gray-code); margin: 0; + overflow-x: auto; } .errorSection {