Skip to content

Commit

Permalink
Merge pull request #367 from airjp73/announcement
Browse files Browse the repository at this point in the history
feat: add v6 announcement to docs
  • Loading branch information
airjp73 authored Apr 30, 2024
2 parents eabb3f2 + bb4eb76 commit 0dbc53f
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/docs/app/components/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const Alert: FC<AlertProps> = ({
className
)}
>
<div className="flex">
<div className="flex items-center">
<div className="flex-shrink-0">
<Icon
className={classNames(
Expand Down
40 changes: 38 additions & 2 deletions apps/docs/app/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ const buttonStyles = (
className
);

export type ButtonProps = {
type BaseButtonProps = {
label: string;
variant?: keyof typeof variantStyles;
icon?: ReactElement;
rightIcon?: ReactElement;
} & JSX.IntrinsicElements["button"];
};
export type ButtonProps = BaseButtonProps &
JSX.IntrinsicElements["button"];

export const Button = forwardRef<
HTMLButtonElement,
Expand Down Expand Up @@ -64,3 +66,37 @@ export const Button = forwardRef<
</button>
)
);

export type ButtonLinkProps = BaseButtonProps &
JSX.IntrinsicElements["a"];

export const ButtonLink = forwardRef<
HTMLAnchorElement,
ButtonLinkProps
>(
(
{
className,
variant = "primary",
label,
icon,
rightIcon,
...rest
},
ref
) => (
<a
className={buttonStyles(variant, className)}
ref={ref}
{...rest}
>
{icon &&
cloneElement(icon, { className: "h-4 w-4 mr-2" })}
{label}
{rightIcon &&
cloneElement(rightIcon, {
className: "h-4 w-4 ml-2",
})}
</a>
)
);
23 changes: 22 additions & 1 deletion apps/docs/app/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { MenuAlt2Icon } from "@heroicons/react/outline";
import { useLocation, useMatches } from "@remix-run/react";
import {
Link,

Check warning on line 3 in apps/docs/app/components/Layout.tsx

View workflow job for this annotation

GitHub Actions / build

'Link' is defined but never used
useLocation,
useMatches,
} from "@remix-run/react";
import React, {
Fragment,
PropsWithChildren,
Expand All @@ -9,6 +13,8 @@ import React, {
import { Sidebar } from "../components/Sidebar";
import { Footer } from "./Footer";
import { GithubIcon } from "./GithubIcon";
import { Alert } from "./Alert";

Check warning on line 16 in apps/docs/app/components/Layout.tsx

View workflow job for this annotation

GitHub Actions / build

`./Alert` import should occur before import of `./Footer`
import { Button, ButtonLink } from "./Button";

Check warning on line 17 in apps/docs/app/components/Layout.tsx

View workflow job for this annotation

GitHub Actions / build

`./Button` import should occur before import of `./Footer`

Check warning on line 17 in apps/docs/app/components/Layout.tsx

View workflow job for this annotation

GitHub Actions / build

'Button' is defined but never used

type Section = {
header: string;
Expand Down Expand Up @@ -225,6 +231,21 @@ export const Layout = ({ children }: LayoutProps) => {
</div>

<div className="flex flex-col flex-1">
<Alert
className="not-prose"
variant="info"
title="v6 is coming!"
details="Check out the RFC to get an early look or leave a comment."
action={
<ButtonLink
href="https://github.com/airjp73/remix-validated-form/discussions/364"
variant="primary"
label="View RFC"
aria-label="Dismiss"
/>
}
/>

<main className="relative focus:outline-none p-8 prose prose-invert flex-1 md:flex-initial">
{children}
</main>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.overrides {
code.hljs {
margin: -11px -15px;
border-radius: .375rem;
border-radius: 0.375rem;
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"vitest:run": "vitest run",
"lint": "eslint --cache .",
"prettier": "prettier --cache --check .",
"format": "prettier --write .",
"build": "turbo run build",
"prepare": "husky install"
},
Expand Down

0 comments on commit 0dbc53f

Please sign in to comment.