|
1 | 1 | import { VscSymbolEvent } from '@react-icons/all-files/vsc/VscSymbolEvent';
|
2 |
| -import { ChevronDown, ChevronUp, Code2 } from 'lucide-react'; |
| 2 | +import { ChevronDown, ChevronUp, Code2, LinkIcon } from 'lucide-react'; |
| 3 | +import Link from 'next/link'; |
| 4 | +import { ENV } from '~/util/env'; |
3 | 5 | import { Badges } from './Badges';
|
4 | 6 | import { DeprecatedNode } from './DeprecatedNode';
|
5 | 7 | import { ExampleNode } from './ExampleNode';
|
@@ -29,17 +31,22 @@ async function EventBodyNode({
|
29 | 31 | <div className="flex place-content-between place-items-center">
|
30 | 32 | <h3
|
31 | 33 | id={event.displayName}
|
32 |
| - className={`${overload ? 'scroll-mt-16' : 'scroll-mt-8'} break-words font-mono font-semibold`} |
| 34 | + className={`${overload ? (ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-24' : 'scroll-mt-16') : ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group break-words font-mono font-semibold`} |
33 | 35 | >
|
34 | 36 | <Badges node={event} /> {event.displayName}
|
35 |
| - {event.typeParameters?.length ? ( |
36 |
| - <> |
37 |
| - {'<'} |
38 |
| - <TypeParameterNode node={event.typeParameters} version={version} /> |
39 |
| - {'>'} |
40 |
| - </> |
41 |
| - ) : null} |
42 |
| - ({event.parameters?.length ? <ParameterNode node={event.parameters} version={version} /> : null}) |
| 37 | + <span> |
| 38 | + <Link href={`#${event.displayName}`} className="float-left -ml-6 hidden pb-2 pr-2 group-hover:block"> |
| 39 | + <LinkIcon aria-hidden size={16} /> |
| 40 | + </Link> |
| 41 | + {event.typeParameters?.length ? ( |
| 42 | + <> |
| 43 | + {'<'} |
| 44 | + <TypeParameterNode node={event.typeParameters} version={version} /> |
| 45 | + {'>'} |
| 46 | + </> |
| 47 | + ) : null} |
| 48 | + ({event.parameters?.length ? <ParameterNode node={event.parameters} version={version} /> : null}) |
| 49 | + </span> |
43 | 50 | </h3>
|
44 | 51 |
|
45 | 52 | <a
|
|
0 commit comments