1
+ import type { SubmissionResult } from '@conform-to/react'
2
+ import type {
3
+ LoaderFunctionArgs ,
4
+ ActionFunctionArgs ,
5
+ LinksFunction ,
6
+ } from '@vercel/remix'
7
+
8
+ import { getFormProps , getInputProps , useForm } from '@conform-to/react'
9
+ import { parseWithZod } from '@conform-to/zod'
10
+ import { invariant } from '@epic-web/invariant'
1
11
import { Dialog } from '@headlessui/react'
2
12
import {
3
13
Form ,
@@ -7,26 +17,19 @@ import {
7
17
useNavigate ,
8
18
useNavigation ,
9
19
} from '@remix-run/react'
10
- import { z } from 'zod'
11
- import { parseWithZod } from '@conform-to/zod'
12
- import { FORM_INTENTS , INTENT } from '~/helpers'
13
- import type { SubmissionResult } from '@conform-to/react'
14
- import { getFormProps , getInputProps , useForm } from '@conform-to/react'
20
+ import { useCopyToClipboard } from '@uidotdev/usehooks'
15
21
import { json } from '@vercel/remix'
16
- import type {
17
- LoaderFunctionArgs ,
18
- ActionFunctionArgs ,
19
- LinksFunction ,
20
- } from '@vercel/remix '
22
+ import { useEffect } from 'react'
23
+ import { jsonWithSuccess , redirectWithError } from 'remix-toast'
24
+ import { z } from 'zod'
25
+
26
+ import { addNewBoardMember , getAllBoardRoles , getBoardById } from './queries '
21
27
import styles from './styles.css'
22
- import { Close , Link as LinkIcon } from '~/icons'
28
+
23
29
import { requireAuthCookie } from '~/auth'
24
- import { invariant } from '@epic-web/invariant'
25
- import { addNewBoardMember , getAllBoardRoles , getBoardById } from './queries'
26
30
import { checkUserAllowedToEditBoard } from '~/db'
27
- import { jsonWithSuccess , redirectWithError } from 'remix-toast'
28
- import { useEffect } from 'react'
29
- import { useCopyToClipboard } from '@uidotdev/usehooks'
31
+ import { FORM_INTENTS , INTENT } from '~/helpers'
32
+ import { Close , Link as LinkIcon } from '~/icons'
30
33
31
34
export const links : LinksFunction = ( ) => [ { rel : 'stylesheet' , href : styles } ]
32
35
@@ -74,7 +77,7 @@ export default function BoardShareRoute() {
74
77
const [ form , fields ] = useForm ( {
75
78
// We throw 403 json from action if user is not allowed to edit board
76
79
// Happens only on API requests
77
- lastResult : lastResult as SubmissionResult < string [ ] > ,
80
+ lastResult : lastResult as SubmissionResult < Array < string > > ,
78
81
onValidate ( { formData } ) {
79
82
return parseWithZod ( formData , { schema } )
80
83
} ,
@@ -150,11 +153,11 @@ export default function BoardShareRoute() {
150
153
151
154
< div className = "panel-footer" >
152
155
< div className = "copy-link-wrapper" >
156
+ { /* eslint-disable-next-line @typescript-eslint/no-misused-promises */ }
153
157
< button type = "button" onClick = { ( ) => copyToClipboard ( shareLink ) } >
154
158
< LinkIcon />
155
159
< span > Copy link</ span >
156
160
</ button >
157
-
158
161
< p >
159
162
{ hasCopiedText
160
163
? 'Copied to clipboard!'
0 commit comments