|
@@ -1,4 +1,5 @@
|
|
|
-import type { ReactNode } from 'react';
|
|
|
|
|
|
|
+// import type { ReactNode } from 'react';
|
|
|
|
|
+import React, { useState } from 'react';
|
|
|
|
|
|
|
|
import dynamic from 'next/dynamic';
|
|
import dynamic from 'next/dynamic';
|
|
|
|
|
|
|
@@ -19,8 +20,8 @@ export type PagePathNavLayoutProps = {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type Props = PagePathNavLayoutProps & {
|
|
type Props = PagePathNavLayoutProps & {
|
|
|
- formerLink?: ReactNode,
|
|
|
|
|
- latterLink?: ReactNode,
|
|
|
|
|
|
|
+ formerLink?: React.ReactNode,
|
|
|
|
|
+ latterLink?: React.ReactNode,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const CopyDropdown = dynamic(() => import('~/client/components/Common/CopyDropdown').then(mod => mod.CopyDropdown), { ssr: false });
|
|
const CopyDropdown = dynamic(() => import('~/client/components/Common/CopyDropdown').then(mod => mod.CopyDropdown), { ssr: false });
|
|
@@ -40,6 +41,19 @@ export const PagePathNavLayout = (props: Props): JSX.Element => {
|
|
|
|
|
|
|
|
const copyDropdownId = `copydropdown-${pageId}`;
|
|
const copyDropdownId = `copydropdown-${pageId}`;
|
|
|
|
|
|
|
|
|
|
+ const [, setIsHovered] = useState(false);
|
|
|
|
|
+ const [hideTimeout, setHideTimeout] = useState<NodeJS.Timeout | null>(null);
|
|
|
|
|
+
|
|
|
|
|
+ const handleMouseEnter = () => {
|
|
|
|
|
+ if (hideTimeout) clearTimeout(hideTimeout); // 非表示タイマーをリセット
|
|
|
|
|
+ setIsHovered(true); // ボタンを表示
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleMouseLeave = () => {
|
|
|
|
|
+ const timeout = setTimeout(() => setIsHovered(false), 3000); // 3秒後にボタンを非表示
|
|
|
|
|
+ setHideTimeout(timeout);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div
|
|
<div
|
|
|
className={`${className} ${moduleClass}`}
|
|
className={`${className} ${moduleClass}`}
|
|
@@ -55,7 +69,11 @@ export const PagePathNavLayout = (props: Props): JSX.Element => {
|
|
|
{ isWipPage && (
|
|
{ isWipPage && (
|
|
|
<span className="badge text-bg-secondary ms-1 me-1">WIP</span>
|
|
<span className="badge text-bg-secondary ms-1 me-1">WIP</span>
|
|
|
)}
|
|
)}
|
|
|
- <span className=" grw-page-path-nav-copydropdown">
|
|
|
|
|
|
|
+ <span
|
|
|
|
|
+ className=" grw-page-path-nav-copydropdown"
|
|
|
|
|
+ onMouseEnter={handleMouseEnter}
|
|
|
|
|
+ onMouseLeave={handleMouseLeave}
|
|
|
|
|
+ >
|
|
|
<CopyDropdown pageId={pageId} pagePath={pagePath} dropdownToggleId={copyDropdownId} dropdownToggleClassName="p-2">
|
|
<CopyDropdown pageId={pageId} pagePath={pagePath} dropdownToggleId={copyDropdownId} dropdownToggleClassName="p-2">
|
|
|
<span className="material-symbols-outlined">content_paste</span>
|
|
<span className="material-symbols-outlined">content_paste</span>
|
|
|
</CopyDropdown>
|
|
</CopyDropdown>
|