Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryosei-Fukushima committed Dec 12, 2024
1 parent 27ea340 commit 0e46e2b
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use '@growi/core-styles/scss/bootstrap/init' as bs;

.grw-page-path-nav-sticky :global {
// width: 100%;

.sticky-inner-wrapper {
z-index: bs.$zindex-sticky;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/app/src/client/components/PagePresentationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ const PagePresentationModal = (): JSX.Element => {
if (!isOpen) {
return <></>;
}

console.log(isEnabledMarp, 'Marp');
console.log(rendererOptions, 'renderOption');
return (
<Modal
isOpen={isOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

.grw-page-path-nav-layout :global {
.grw-page-path-nav-copydropdown {
display: none;
visibility: hidden; /* 通常時は非表示(スペースは維持) */
// display: none;
@include bs.media-breakpoint-down(md) {
display: block;
}
Expand All @@ -15,7 +16,9 @@
&:global {
&:hover {
.grw-page-path-nav-copydropdown {
display: block;
visibility: visible; /* ホバー時に表示 */
// opacity: 1;
// display: block;
}
}
}
Expand Down
26 changes: 22 additions & 4 deletions apps/app/src/components/Common/PagePathNav/PagePathNavLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactNode } from 'react';
// import type { ReactNode } from 'react';
import React, { useState } from 'react';

import dynamic from 'next/dynamic';

Expand All @@ -19,8 +20,8 @@ export type 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 });
Expand All @@ -40,6 +41,19 @@ export const PagePathNavLayout = (props: Props): JSX.Element => {

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 (
<div
className={`${className} ${moduleClass}`}
Expand All @@ -55,7 +69,11 @@ export const PagePathNavLayout = (props: Props): JSX.Element => {
{ isWipPage && (
<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">
<span className="material-symbols-outlined">content_paste</span>
</CopyDropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
.grw-page-path-nav-title :global {
min-height: 75px;
}

.grw-page-path-nav-title:hover {
background-color: rgba(0, 0, 0, 0.05); /* ホバー範囲を視覚的に確認したい場合の背景 */
}
2 changes: 1 addition & 1 deletion apps/app/src/pages/[[...path]].page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ const Page: NextPageWithLayout<Props> = (props: Props) => {
useDefaultIndentSize(props.adminPreferredIndentSize);
useIsIndentSizeForced(props.isIndentSizeForced);
useDisableLinkSharing(props.disableLinkSharing);
useRendererConfig(props.rendererConfig);
// useRendererConfig(props.rendererConfig);
useIsEnabledMarp(props.rendererConfig.isEnabledMarp);
// useRendererSettings(props.rendererSettingsStr != null ? JSON.parse(props.rendererSettingsStr) : undefined);
// useGrowiRendererConfig(props.growiRendererConfigStr != null ? JSON.parse(props.growiRendererConfigStr) : undefined);
Expand Down
1 change: 1 addition & 0 deletions apps/app/src/stores-universal/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export const useIsEnabledStaleNotification = (initialData?: boolean): SWRRespons
};

export const useRendererConfig = (initialData?: RendererConfig): SWRResponse<RendererConfig, any> => {
console.log(initialData, 'undifined or null');
return useContextSWR('growiRendererConfig', initialData);
};

Expand Down
5 changes: 5 additions & 0 deletions apps/app/src/stores/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ export const useCustomSidebarOptions = (config?: SWRConfiguration): SWRResponse<
export const usePresentationViewOptions = (): SWRResponse<RendererOptions, Error> => {
const { data: currentPagePath } = useCurrentPagePath();
const { data: rendererConfig } = useRendererConfig();
console.log(rendererConfig, 'rendererconfig');
if (!rendererConfig) {
console.log('RendererConfig is missing.');
}


const isAllDataValid = currentPagePath != null && rendererConfig != null;

Expand Down

0 comments on commit 0e46e2b

Please sign in to comment.