Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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