Skip to content

Commit 36485f3

Browse files
Merge pull request #2683 from appwrite/copy-page-logic
2 parents 8fac10b + dd766af commit 36485f3

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/lib/layouts/DocsArticle.svelte

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import { Button, Icon } from '$lib/components/ui';
2828
import Info from '$markdoc/tags/Info.svelte';
2929
import CopyAsMarkdown from '$lib/components/blog/copy-as-markdown.svelte';
30+
import { hasRoutePrompt } from '$lib/utils/routePrompts';
3031
3132
export let title: string;
3233
export let toc: Array<TocItem>;
@@ -37,6 +38,8 @@
3738
const headerSectionInfoAlert = hasContext('headerSectionInfoAlert')
3839
? getContext<Readable<HeaderSectionInfoAlert | null>>('headerSectionInfoAlert')
3940
: readable(null);
41+
42+
const showCopyPage = !hasRoutePrompt();
4043
</script>
4144

4245
<main class="contents" id="main">
@@ -49,9 +52,11 @@
4952
<span class="web-icon-chevron-left" aria-hidden="true"></span>
5053
</a>
5154
{/if}
52-
<div class="copy-button-wrapper-mobile ml-auto">
53-
<CopyAsMarkdown class="ml-0" />
54-
</div>
55+
{#if showCopyPage}
56+
<div class="copy-button-wrapper-mobile ml-auto">
57+
<CopyAsMarkdown class="ml-0" />
58+
</div>
59+
{/if}
5560
</div>
5661
<ul class="web-metadata text-caption">
5762
<slot name="metadata" />
@@ -75,9 +80,11 @@
7580
<h1 class="text-title font-aeonik-pro text-primary">{title}</h1>
7681
</div>
7782
</div>
78-
<div class="web-article-header-end copy-button-wrapper hidden lg:block">
79-
<CopyAsMarkdown class="ml-0" />
80-
</div>
83+
{#if showCopyPage}
84+
<div class="web-article-header-end copy-button-wrapper hidden lg:block">
85+
<CopyAsMarkdown class="ml-0" />
86+
</div>
87+
{/if}
8188
</header>
8289
<div class="web-article-content prose" class:web-reduced-article-size={$reducedArticleSize}>
8390
<slot />

0 commit comments

Comments
 (0)