Skip to content

Commit

Permalink
docs(feat): add analytics & feedback forms to docs (#2040)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaellis authored Dec 7, 2022
1 parent a6e4ffe commit 64f2b0d
Show file tree
Hide file tree
Showing 16 changed files with 602 additions and 34 deletions.
12 changes: 11 additions & 1 deletion docs/app/components/Buttons/GradientButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface GradientButtonProps {
tag?: keyof JSX.IntrinsicElements
className?: string
variant?: 'regular' | 'small'
type?: 'button' | 'submit'
}

export const GradientButton = ({
Expand All @@ -15,16 +16,25 @@ export const GradientButton = ({
children,
tag,
variant = 'regular',
type = 'button',
...props
}: GradientButtonProps) => {
return (
<Button size={variant} className={className} as={tag} href={href}>
<Button
size={variant}
className={className}
as={tag}
href={href}
type={tag === 'button' ? type : undefined}
{...props}>
<span>{children}</span>
</Button>
)
}

const Button = styled('a', {
color: '$steel100',
border: 'none',
borderRadius: '$r8',
p: 2,
backgroundClip: 'content-box',
Expand Down
11 changes: 1 addition & 10 deletions docs/app/components/Buttons/NavButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@ import {
ForwardRefExoticComponent,
MouseEventHandler,
RefAttributes,
useRef,
useState,
} from 'react'
import { Link, useLocation } from '@remix-run/react'
import {
animated,
SpringValue,
useSpring,
useTransition,
} from '@react-spring/web'
import { useLocation } from '@remix-run/react'
import * as Toolbar from '@radix-ui/react-toolbar'
import * as Tooltip from '@radix-ui/react-tooltip'
import { IconProps } from 'phosphor-react'

import { dark, styled } from '~/styles/stitches.config'
Expand Down
15 changes: 14 additions & 1 deletion docs/app/components/Cards/CardExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@ import { GradientButton } from '../Buttons/GradientButton'

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

import { EventNames, firePlausibleEvent } from '~/helpers/analytics'

export const CardExample = ({ title, description, tags, id }: Sandbox) => {
const handleClick = () => {
firePlausibleEvent({
name: EventNames.LinkedToSandbox,
additionalProps: {
title,
},
})
}

return (
<ExampleAnchor href={`https://codesandbox.io/s/${id}`}>
<ExampleAnchor
href={`https://codesandbox.io/s/${id}`}
onClick={handleClick}>
<ExampleCard>
<ExternalLinkIcon />
<ExampleImage height={9} width={16}>
Expand Down
Loading

0 comments on commit 64f2b0d

Please sign in to comment.