|
1 |
| -import * as React from 'react' |
2 |
| -import { FaEdit } from 'react-icons/fa' |
3 | 1 | import { marked } from 'marked'
|
4 | 2 | import markedAlert from 'marked-alert'
|
5 |
| -import { gfmHeadingId, getHeadingList } from 'marked-gfm-heading-id' |
6 |
| -import { DocTitle } from '~/components/DocTitle' |
7 |
| -import { Markdown } from '~/components/Markdown' |
8 |
| -import { Toc } from './Toc' |
9 |
| -import { twMerge } from 'tailwind-merge' |
10 |
| -import { TocMobile } from './TocMobile' |
11 |
| -import { GamLeader } from './Gam' |
12 |
| -import { AdGate } from '~/contexts/AdsContext' |
13 |
| -import { useWidthToggle } from '~/components/DocsLayout' |
| 3 | +import { getHeadingList, gfmHeadingId } from 'marked-gfm-heading-id' |
| 4 | +import * as React from 'react' |
14 | 5 | import {
|
15 | 6 | BsArrowsCollapseVertical,
|
16 | 7 | BsArrowsExpandVertical,
|
17 | 8 | } from 'react-icons/bs'
|
| 9 | +import { FaEdit } from 'react-icons/fa' |
| 10 | +import { twMerge } from 'tailwind-merge' |
| 11 | +import { useWidthToggle } from '~/components/DocsLayout' |
| 12 | +import { DocTitle } from '~/components/DocTitle' |
| 13 | +import { Markdown } from '~/components/Markdown' |
| 14 | +import { AdGate } from '~/contexts/AdsContext' |
| 15 | +import { CopyMarkdownButton } from './CopyMarkdownButton' |
| 16 | +import { GamLeader } from './Gam' |
| 17 | +import { Toc } from './Toc' |
| 18 | +import { TocMobile } from './TocMobile' |
18 | 19 |
|
19 | 20 | type DocProps = {
|
20 | 21 | title: string
|
@@ -130,19 +131,27 @@ export function Doc({
|
130 | 131 | {title ? (
|
131 | 132 | <div className="flex items-center justify-between gap-4">
|
132 | 133 | <DocTitle>{title}</DocTitle>
|
133 |
| - {setIsFullWidth && ( |
134 |
| - <button |
135 |
| - onClick={() => setIsFullWidth(!isFullWidth)} |
136 |
| - className="p-2 mr-4 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors shrink-0 hidden [@media(min-width:1800px)]:inline-flex" |
137 |
| - title={isFullWidth ? 'Constrain width' : 'Expand width'} |
138 |
| - > |
139 |
| - {isFullWidth ? ( |
140 |
| - <BsArrowsCollapseVertical className="w-4 h-4" /> |
141 |
| - ) : ( |
142 |
| - <BsArrowsExpandVertical className="w-4 h-4" /> |
143 |
| - )} |
144 |
| - </button> |
145 |
| - )} |
| 134 | + <div className="flex items-center gap-4"> |
| 135 | + <CopyMarkdownButton |
| 136 | + repo={repo} |
| 137 | + branch={branch} |
| 138 | + filePath={filePath} |
| 139 | + /> |
| 140 | + |
| 141 | + {setIsFullWidth && ( |
| 142 | + <button |
| 143 | + onClick={() => setIsFullWidth(!isFullWidth)} |
| 144 | + className="p-2 mr-4 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors shrink-0 hidden [@media(min-width:1800px)]:inline-flex" |
| 145 | + title={isFullWidth ? 'Constrain width' : 'Expand width'} |
| 146 | + > |
| 147 | + {isFullWidth ? ( |
| 148 | + <BsArrowsCollapseVertical className="w-4 h-4" /> |
| 149 | + ) : ( |
| 150 | + <BsArrowsExpandVertical className="w-4 h-4" /> |
| 151 | + )} |
| 152 | + </button> |
| 153 | + )} |
| 154 | + </div> |
146 | 155 | </div>
|
147 | 156 | ) : null}
|
148 | 157 | <div className="h-4" />
|
|
0 commit comments