File tree 5 files changed +63
-5
lines changed
5 files changed +63
-5
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export const Alert: FC<AlertProps> = ({
50
50
className
51
51
) }
52
52
>
53
- < div className = "flex" >
53
+ < div className = "flex items-center " >
54
54
< div className = "flex-shrink-0" >
55
55
< Icon
56
56
className = { classNames (
Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ const buttonStyles = (
24
24
className
25
25
) ;
26
26
27
- export type ButtonProps = {
27
+ type BaseButtonProps = {
28
28
label : string ;
29
29
variant ?: keyof typeof variantStyles ;
30
30
icon ?: ReactElement ;
31
31
rightIcon ?: ReactElement ;
32
- } & JSX . IntrinsicElements [ "button" ] ;
32
+ } ;
33
+ export type ButtonProps = BaseButtonProps &
34
+ JSX . IntrinsicElements [ "button" ] ;
33
35
34
36
export const Button = forwardRef <
35
37
HTMLButtonElement ,
@@ -64,3 +66,37 @@ export const Button = forwardRef<
64
66
</ button >
65
67
)
66
68
) ;
69
+
70
+ export type ButtonLinkProps = BaseButtonProps &
71
+ JSX . IntrinsicElements [ "a" ] ;
72
+
73
+ export const ButtonLink = forwardRef <
74
+ HTMLAnchorElement ,
75
+ ButtonLinkProps
76
+ > (
77
+ (
78
+ {
79
+ className,
80
+ variant = "primary" ,
81
+ label,
82
+ icon,
83
+ rightIcon,
84
+ ...rest
85
+ } ,
86
+ ref
87
+ ) => (
88
+ < a
89
+ className = { buttonStyles ( variant , className ) }
90
+ ref = { ref }
91
+ { ...rest }
92
+ >
93
+ { icon &&
94
+ cloneElement ( icon , { className : "h-4 w-4 mr-2" } ) }
95
+ { label }
96
+ { rightIcon &&
97
+ cloneElement ( rightIcon , {
98
+ className : "h-4 w-4 ml-2" ,
99
+ } ) }
100
+ </ a >
101
+ )
102
+ ) ;
Original file line number Diff line number Diff line change 1
1
import { MenuAlt2Icon } from "@heroicons/react/outline" ;
2
- import { useLocation , useMatches } from "@remix-run/react" ;
2
+ import {
3
+ Link ,
4
+ useLocation ,
5
+ useMatches ,
6
+ } from "@remix-run/react" ;
3
7
import React , {
4
8
Fragment ,
5
9
PropsWithChildren ,
@@ -9,6 +13,8 @@ import React, {
9
13
import { Sidebar } from "../components/Sidebar" ;
10
14
import { Footer } from "./Footer" ;
11
15
import { GithubIcon } from "./GithubIcon" ;
16
+ import { Alert } from "./Alert" ;
17
+ import { Button , ButtonLink } from "./Button" ;
12
18
13
19
type Section = {
14
20
header : string ;
@@ -225,6 +231,21 @@ export const Layout = ({ children }: LayoutProps) => {
225
231
</ div >
226
232
227
233
< div className = "flex flex-col flex-1" >
234
+ < Alert
235
+ className = "not-prose"
236
+ variant = "info"
237
+ title = "v6 is coming!"
238
+ details = "Check out the RFC to get an early look or leave a comment."
239
+ action = {
240
+ < ButtonLink
241
+ href = "https://github.com/airjp73/remix-validated-form/discussions/364"
242
+ variant = "primary"
243
+ label = "View RFC"
244
+ aria-label = "Dismiss"
245
+ />
246
+ }
247
+ />
248
+
228
249
< main className = "relative focus:outline-none p-8 prose prose-invert flex-1 md:flex-initial" >
229
250
{ children }
230
251
</ main >
Original file line number Diff line number Diff line change 25
25
.overrides {
26
26
code .hljs {
27
27
margin : -11px -15px ;
28
- border-radius : .375rem ;
28
+ border-radius : 0 .375rem ;
29
29
}
30
30
}
31
31
}
Original file line number Diff line number Diff line change 18
18
"vitest:run" : " vitest run" ,
19
19
"lint" : " eslint --cache ." ,
20
20
"prettier" : " prettier --cache --check ." ,
21
+ "format" : " prettier --write ." ,
21
22
"build" : " turbo run build" ,
22
23
"prepare" : " husky install"
23
24
},
You can’t perform that action at this time.
0 commit comments