From 4b806374819fcd728846ac1f0537262ae8e7ead8 Mon Sep 17 00:00:00 2001 From: GauthierWebDev Date: Tue, 22 Apr 2025 12:19:44 +0000 Subject: [PATCH] fix/layout-width (#19) Reviewed-on: https://gitea.gauthierdaniels.fr/GauthierWebDev/memento-dev/pulls/19 Co-authored-by: GauthierWebDev Co-committed-by: GauthierWebDev --- app/components/Callout.tsx | 2 +- app/components/PrevNextLinks.tsx | 2 +- app/components/SmoothScroll.tsx | 2 ++ app/components/Snippet.tsx | 38 ++++++++++++++++---------------- app/layouts/DocsLayout.tsx | 4 ++-- app/partials/LatestDocs.tsx | 2 +- 6 files changed, 26 insertions(+), 24 deletions(-) diff --git a/app/components/Callout.tsx b/app/components/Callout.tsx index f2a3f3e..d29b799 100644 --- a/app/components/Callout.tsx +++ b/app/components/Callout.tsx @@ -42,7 +42,7 @@ export default function Callout(props: { return (
+
{getNeighboringLinks()[0] && ( { if (isMobile()) return; + if (event.ctrlKey) return; + if (event.metaKey) return; const hoveredElement = document.elementFromPoint( event.clientX, diff --git a/app/components/Snippet.tsx b/app/components/Snippet.tsx index 77bd30d..136e09c 100644 --- a/app/components/Snippet.tsx +++ b/app/components/Snippet.tsx @@ -131,25 +131,25 @@ export function Snippet(props: SnippetProps) {
- {selectedTab() && ( -
- {selectedTab().code && ( - - {(selectedTab() as SnippetTab).code} - - )} - {!selectedTab().code && ( -
{(selectedTab() as CommonTab).children}
- )} -
- )} + + {(tab) => ( +
+ {tab.code && ( + + {tab.code} + + )} + {!tab.code &&
{tab.children}
} +
+ )} +
); diff --git a/app/layouts/DocsLayout.tsx b/app/layouts/DocsLayout.tsx index c8e44b0..767658a 100644 --- a/app/layouts/DocsLayout.tsx +++ b/app/layouts/DocsLayout.tsx @@ -25,7 +25,7 @@ export function DocsLayout(props: DocsLayoutProps) {
{props.children}
-
+ ); diff --git a/app/partials/LatestDocs.tsx b/app/partials/LatestDocs.tsx index f1ae701..1c8c051 100644 --- a/app/partials/LatestDocs.tsx +++ b/app/partials/LatestDocs.tsx @@ -8,7 +8,7 @@ export function LatestDocs() { const data = useData(); return ( -
+

Dernières documentations