Skip to content

Commit 64f2b0d

Browse files
authored
docs(feat): add analytics & feedback forms to docs (pmndrs#2040)
1 parent a6e4ffe commit 64f2b0d

File tree

16 files changed

+602
-34
lines changed

16 files changed

+602
-34
lines changed

docs/app/components/Buttons/GradientButton.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ interface GradientButtonProps {
77
tag?: keyof JSX.IntrinsicElements
88
className?: string
99
variant?: 'regular' | 'small'
10+
type?: 'button' | 'submit'
1011
}
1112

1213
export const GradientButton = ({
@@ -15,16 +16,25 @@ export const GradientButton = ({
1516
children,
1617
tag,
1718
variant = 'regular',
19+
type = 'button',
20+
...props
1821
}: GradientButtonProps) => {
1922
return (
20-
<Button size={variant} className={className} as={tag} href={href}>
23+
<Button
24+
size={variant}
25+
className={className}
26+
as={tag}
27+
href={href}
28+
type={tag === 'button' ? type : undefined}
29+
{...props}>
2130
<span>{children}</span>
2231
</Button>
2332
)
2433
}
2534

2635
const Button = styled('a', {
2736
color: '$steel100',
37+
border: 'none',
2838
borderRadius: '$r8',
2939
p: 2,
3040
backgroundClip: 'content-box',

docs/app/components/Buttons/NavButton.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,9 @@ import {
22
ForwardRefExoticComponent,
33
MouseEventHandler,
44
RefAttributes,
5-
useRef,
6-
useState,
75
} from 'react'
8-
import { Link, useLocation } from '@remix-run/react'
9-
import {
10-
animated,
11-
SpringValue,
12-
useSpring,
13-
useTransition,
14-
} from '@react-spring/web'
6+
import { useLocation } from '@remix-run/react'
157
import * as Toolbar from '@radix-ui/react-toolbar'
16-
import * as Tooltip from '@radix-ui/react-tooltip'
178
import { IconProps } from 'phosphor-react'
189

1910
import { dark, styled } from '~/styles/stitches.config'

docs/app/components/Cards/CardExample.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,22 @@ import { GradientButton } from '../Buttons/GradientButton'
77

88
import type { Sandbox } from '../../routes/examples'
99

10+
import { EventNames, firePlausibleEvent } from '~/helpers/analytics'
11+
1012
export const CardExample = ({ title, description, tags, id }: Sandbox) => {
13+
const handleClick = () => {
14+
firePlausibleEvent({
15+
name: EventNames.LinkedToSandbox,
16+
additionalProps: {
17+
title,
18+
},
19+
})
20+
}
21+
1122
return (
12-
<ExampleAnchor href={`https://codesandbox.io/s/${id}`}>
23+
<ExampleAnchor
24+
href={`https://codesandbox.io/s/${id}`}
25+
onClick={handleClick}>
1326
<ExampleCard>
1427
<ExternalLinkIcon />
1528
<ExampleImage height={9} width={16}>

0 commit comments

Comments
 (0)