Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
2c11ad9b
Commit
2c11ad9b
authored
Mar 05, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
public tag submit form
parent
b8789b81
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
229 additions
and
187 deletions
+229
-187
submit.tsx
pages/public-tags/submit.tsx
+2
-2
PublicTagsSubmitForm.tsx
ui/publicTags/submit/PublicTagsSubmitForm.tsx
+9
-12
PublicTagsSubmitResult.tsx
ui/publicTags/submit/PublicTagsSubmitResult.tsx
+13
-7
PublicTagsSubmitFieldAddresses.tsx
...blicTags/submit/fields/PublicTagsSubmitFieldAddresses.tsx
+11
-9
PublicTagsSubmitFieldTag.tsx
ui/publicTags/submit/fields/PublicTagsSubmitFieldTag.tsx
+27
-28
PublicTagsSubmitFieldTagColor.tsx
...ublicTags/submit/fields/PublicTagsSubmitFieldTagColor.tsx
+0
-73
PublicTagsSubmitFieldTagType.tsx
ui/publicTags/submit/fields/PublicTagsSubmitFieldTagType.tsx
+47
-48
PublicTagsSubmitFieldTags.tsx
ui/publicTags/submit/fields/PublicTagsSubmitFieldTags.tsx
+1
-1
types.ts
ui/publicTags/submit/types.ts
+1
-1
utils.ts
ui/publicTags/submit/utils.ts
+3
-3
FormFieldColor.tsx
ui/shared/forms/fields/FormFieldColor.tsx
+109
-0
FormFieldText.tsx
ui/shared/forms/fields/FormFieldText.tsx
+1
-1
color.ts
ui/shared/forms/validators/color.ts
+5
-1
TokenInfoForm.tsx
ui/tokenInfo/TokenInfoForm.tsx
+0
-1
No files found.
pages/public-tags/submit.tsx
View file @
2c11ad9b
...
@@ -3,12 +3,12 @@ import React from 'react';
...
@@ -3,12 +3,12 @@ import React from 'react';
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
import
PageNextJs
from
'
nextjs/PageNextJs
'
;
//
import PublicTagsSubmit from 'ui/pages/PublicTagsSubmit';
import
PublicTagsSubmit
from
'
ui/pages/PublicTagsSubmit
'
;
const
Page
:
NextPage
=
()
=>
{
const
Page
:
NextPage
=
()
=>
{
return
(
return
(
<
PageNextJs
pathname=
"/public-tags/submit"
>
<
PageNextJs
pathname=
"/public-tags/submit"
>
{
/* <PublicTagsSubmit/> */
}
<
PublicTagsSubmit
/>
</
PageNextJs
>
</
PageNextJs
>
);
);
};
};
...
...
ui/publicTags/submit/PublicTagsSubmitForm.tsx
View file @
2c11ad9b
import
{
Button
,
chakra
,
Grid
,
GridItem
}
from
'
@chakra-ui/react
'
;
import
{
chakra
,
Grid
,
GridItem
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
SubmitHandler
}
from
'
react-hook-form
'
;
import
type
{
SubmitHandler
}
from
'
react-hook-form
'
;
...
@@ -13,6 +13,7 @@ import useApiFetch from 'lib/api/useApiFetch';
...
@@ -13,6 +13,7 @@ import useApiFetch from 'lib/api/useApiFetch';
import
getErrorObj
from
'
lib/errors/getErrorObj
'
;
import
getErrorObj
from
'
lib/errors/getErrorObj
'
;
import
getErrorObjPayload
from
'
lib/errors/getErrorObjPayload
'
;
import
getErrorObjPayload
from
'
lib/errors/getErrorObjPayload
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
{
Button
}
from
'
toolkit/chakra/button
'
;
import
FormFieldEmail
from
'
ui/shared/forms/fields/FormFieldEmail
'
;
import
FormFieldEmail
from
'
ui/shared/forms/fields/FormFieldEmail
'
;
import
FormFieldText
from
'
ui/shared/forms/fields/FormFieldText
'
;
import
FormFieldText
from
'
ui/shared/forms/fields/FormFieldText
'
;
import
FormFieldUrl
from
'
ui/shared/forms/fields/FormFieldUrl
'
;
import
FormFieldUrl
from
'
ui/shared/forms/fields/FormFieldUrl
'
;
...
@@ -84,10 +85,6 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
...
@@ -84,10 +85,6 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
return
null
;
return
null
;
}
}
const
fieldProps
=
{
size
:
{
base
:
'
md
'
,
lg
:
'
lg
'
},
};
return
(
return
(
<
FormProvider
{
...
formApi
}
>
<
FormProvider
{
...
formApi
}
>
<
chakra
.
form
<
chakra
.
form
...
@@ -102,12 +99,12 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
...
@@ -102,12 +99,12 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
3
}
}
as=
"h2"
textStyle=
"h4"
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
3
}
}
as=
"h2"
textStyle=
"h4"
>
Company info
Company info
</
GridItem
>
</
GridItem
>
<
FormFieldText
<
FormFields
>
name="requesterName"
isRequired placeholder="Your name"
{
...
fieldProps
}
/
>
<
FormFieldText
<
FormFields
>
name="requesterName"
required placeholder="Your name"
/
>
<
FormFieldEmail
<
FormFields
>
name="requesterEmail"
isRequired
{
...
fieldProps
}
/
>
<
FormFieldEmail
<
FormFields
>
name="requesterEmail"
required
/
>
{
!
isMobile
&&
<
div
/>
}
{
!
isMobile
&&
<
div
/>
}
<
FormFieldText
<
FormFields
>
name="companyName" placeholder="Company name"
{
...
fieldProps
}
/
>
<
FormFieldText
<
FormFields
>
name="companyName" placeholder="Company name"/
>
<
FormFieldUrl
<
FormFields
>
name="companyWebsite" placeholder="Company website"
{
...
fieldProps
}
/
>
<
FormFieldUrl
<
FormFields
>
name="companyWebsite" placeholder="Company website"/
>
{
!
isMobile
&&
<
div
/>
}
{
!
isMobile
&&
<
div
/>
}
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
3
}
}
as=
"h2"
textStyle=
"h4"
mt=
{
{
base
:
3
,
lg
:
5
}
}
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
3
}
}
as=
"h2"
textStyle=
"h4"
mt=
{
{
base
:
3
,
lg
:
5
}
}
>
...
@@ -119,7 +116,7 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
...
@@ -119,7 +116,7 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
<
FormFieldText
<
FormFields
>
<
FormFieldText
<
FormFields
>
name="description"
name="description"
isR
equired
r
equired
placeholder=
{
placeholder=
{
isMobile
?
isMobile
?
'
Confirm the connection between addresses and tags.
'
:
'
Confirm the connection between addresses and tags.
'
:
...
@@ -128,7 +125,7 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
...
@@ -128,7 +125,7 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
maxH="160px"
maxH="160px"
rules=
{
{
maxLength
:
80
}
}
rules=
{
{
maxLength
:
80
}
}
asComponent="Textarea"
asComponent="Textarea"
{
...
fieldProps
}
size="2xl"
/
>
/
>
</
GridItem
>
</
GridItem
>
...
@@ -141,7 +138,7 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
...
@@ -141,7 +138,7 @@ const PublicTagsSubmitForm = ({ config, userInfo, onSubmitResult }: Props) => {
size=
"lg"
size=
"lg"
type=
"submit"
type=
"submit"
mt=
{
3
}
mt=
{
3
}
isL
oading=
{
formApi
.
formState
.
isSubmitting
}
l
oading=
{
formApi
.
formState
.
isSubmitting
}
loadingText=
"Send request"
loadingText=
"Send request"
w=
"min-content"
w=
"min-content"
>
>
...
...
ui/publicTags/submit/PublicTagsSubmitResult.tsx
View file @
2c11ad9b
import
{
Alert
,
Box
,
Button
,
Flex
,
Grid
,
GridItem
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
,
Grid
,
GridItem
}
from
'
@chakra-ui/react
'
;
import
{
pickBy
}
from
'
es-toolkit
'
;
import
{
pickBy
}
from
'
es-toolkit
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -7,7 +7,9 @@ import type { FormSubmitResult } from './types';
...
@@ -7,7 +7,9 @@ import type { FormSubmitResult } from './types';
import
{
route
}
from
'
nextjs-routes
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
makePrettyLink
from
'
lib/makePrettyLink
'
;
import
makePrettyLink
from
'
lib/makePrettyLink
'
;
import
LinkExternal
from
'
ui/shared/links/LinkExternal
'
;
import
{
Alert
}
from
'
toolkit/chakra/alert
'
;
import
{
Button
}
from
'
toolkit/chakra/button
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
PublicTagsSubmitResultSuccess
from
'
./result/PublicTagsSubmitResultSuccess
'
;
import
PublicTagsSubmitResultSuccess
from
'
./result/PublicTagsSubmitResultSuccess
'
;
import
PublicTagsSubmitResultWithErrors
from
'
./result/PublicTagsSubmitResultWithErrors
'
;
import
PublicTagsSubmitResultWithErrors
from
'
./result/PublicTagsSubmitResultWithErrors
'
;
...
@@ -57,7 +59,7 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
...
@@ -57,7 +59,7 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
<>
<>
<
GridItem
>
Company website
</
GridItem
>
<
GridItem
>
Company website
</
GridItem
>
<
GridItem
>
<
GridItem
>
<
Link
External
href=
{
companyWebsite
.
url
}
>
{
companyWebsite
.
domain
}
</
LinkExternal
>
<
Link
external
href=
{
companyWebsite
.
url
}
>
{
companyWebsite
.
domain
}
</
Link
>
</
GridItem
>
</
GridItem
>
</>
</>
)
}
)
}
...
@@ -68,11 +70,15 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
...
@@ -68,11 +70,15 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
<
Flex
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
columnGap=
{
6
}
mt=
{
8
}
rowGap=
{
3
}
>
<
Flex
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
columnGap=
{
6
}
mt=
{
8
}
rowGap=
{
3
}
>
{
hasErrors
&&
(
{
hasErrors
&&
(
<
Button
size=
"lg"
variant=
"outline"
as=
"a"
href=
{
route
({
pathname
:
'
/public-tags/submit
'
,
query
:
startOverButtonQuery
})
}
>
<
Link
href=
{
route
({
pathname
:
'
/public-tags/submit
'
,
query
:
startOverButtonQuery
})
}
asChild
>
<
Button
size=
"lg"
variant=
"outline"
>
Start over
Start over
</
Button
>
</
Button
>
</
Link
>
)
}
)
}
<
Button
size=
"lg"
as=
"a"
href=
{
route
({
pathname
:
'
/public-tags/submit
'
})
}
>
Add new tag
</
Button
>
<
Link
href=
{
route
({
pathname
:
'
/public-tags/submit
'
})
}
asChild
>
<
Button
size=
"lg"
>
Add new tag
</
Button
>
</
Link
>
</
Flex
>
</
Flex
>
</
div
>
</
div
>
);
);
...
...
ui/publicTags/submit/fields/PublicTagsSubmitFieldAddresses.tsx
View file @
2c11ad9b
import
{
GridItem
,
IconButton
}
from
'
@chakra-ui/react
'
;
import
{
GridItem
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
useFieldArray
,
useFormContext
}
from
'
react-hook-form
'
;
import
{
useFieldArray
,
useFormContext
}
from
'
react-hook-form
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
{
IconButton
}
from
'
toolkit/chakra/icon-button
'
;
import
FormFieldAddress
from
'
ui/shared/forms/fields/FormFieldAddress
'
;
import
FormFieldAddress
from
'
ui/shared/forms/fields/FormFieldAddress
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
...
@@ -40,9 +41,8 @@ const PublicTagsSubmitFieldAddresses = () => {
...
@@ -40,9 +41,8 @@ const PublicTagsSubmitFieldAddresses = () => {
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
<
FormFieldAddress
<
FormFields
>
<
FormFieldAddress
<
FormFields
>
name=
{
`addresses.${ index }.hash`
}
name=
{
`addresses.${ index }.hash`
}
isR
equired
r
equired
placeholder="Smart contract / Address (0x...)"
placeholder="Smart contract / Address (0x...)"
size=
{
{
base
:
'
md
'
,
lg
:
'
lg
'
}
}
/
>
/
>
</
GridItem
>
</
GridItem
>
<
GridItem
display=
"flex"
alignItems=
"center"
columnGap=
{
5
}
justifyContent=
{
{
base
:
'
flex-end
'
,
lg
:
'
flex-start
'
}
}
>
<
GridItem
display=
"flex"
alignItems=
"center"
columnGap=
{
5
}
justifyContent=
{
{
base
:
'
flex-end
'
,
lg
:
'
flex-start
'
}
}
>
...
@@ -53,9 +53,10 @@ const PublicTagsSubmitFieldAddresses = () => {
...
@@ -53,9 +53,10 @@ const PublicTagsSubmitFieldAddresses = () => {
variant=
"outline"
variant=
"outline"
boxSize=
"30px"
boxSize=
"30px"
onClick=
{
handleAddFieldClick
}
onClick=
{
handleAddFieldClick
}
icon=
{
<
IconSvg
name=
"plus"
boxSize=
{
5
}
/>
}
disabled=
{
isDisabled
}
isDisabled=
{
isDisabled
}
>
/>
<
IconSvg
name=
"plus"
boxSize=
{
5
}
/>
</
IconButton
>
)
}
)
}
{
fields
.
length
>
1
&&
(
{
fields
.
length
>
1
&&
(
<
IconButton
<
IconButton
...
@@ -64,9 +65,10 @@ const PublicTagsSubmitFieldAddresses = () => {
...
@@ -64,9 +65,10 @@ const PublicTagsSubmitFieldAddresses = () => {
variant=
"outline"
variant=
"outline"
boxSize=
"30px"
boxSize=
"30px"
onClick=
{
handleRemoveFieldClick
}
onClick=
{
handleRemoveFieldClick
}
icon=
{
<
IconSvg
name=
"minus"
boxSize=
{
5
}
/>
}
disabled=
{
isDisabled
}
isDisabled=
{
isDisabled
}
>
/>
<
IconSvg
name=
"minus"
boxSize=
{
5
}
/>
</
IconButton
>
)
}
)
}
</
GridItem
>
</
GridItem
>
</
React
.
Fragment
>
</
React
.
Fragment
>
...
...
ui/publicTags/submit/fields/PublicTagsSubmitFieldTag.tsx
View file @
2c11ad9b
import
{
chakra
,
Flex
,
Grid
,
GridItem
,
IconButton
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
chakra
,
Flex
,
Grid
,
GridItem
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
type
FieldError
,
type
FieldErrorsImpl
,
type
Merge
}
from
'
react-hook-form
'
;
import
{
type
FieldError
,
type
FieldErrorsImpl
,
type
Merge
}
from
'
react-hook-form
'
;
...
@@ -6,15 +6,21 @@ import type { FormFields, FormFieldTag } from '../types';
...
@@ -6,15 +6,21 @@ import type { FormFields, FormFieldTag } from '../types';
import
type
{
PublicTagType
}
from
'
types/api/addressMetadata
'
;
import
type
{
PublicTagType
}
from
'
types/api/addressMetadata
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
{
IconButton
}
from
'
toolkit/chakra/icon-button
'
;
import
EntityTag
from
'
ui/shared/EntityTags/EntityTag
'
;
import
EntityTag
from
'
ui/shared/EntityTags/EntityTag
'
;
import
FormFieldColor
from
'
ui/shared/forms/fields/FormFieldColor
'
;
import
FormFieldText
from
'
ui/shared/forms/fields/FormFieldText
'
;
import
FormFieldText
from
'
ui/shared/forms/fields/FormFieldText
'
;
import
FormFieldUrl
from
'
ui/shared/forms/fields/FormFieldUrl
'
;
import
FormFieldUrl
from
'
ui/shared/forms/fields/FormFieldUrl
'
;
import
{
validator
as
colorValidator
}
from
'
ui/shared/forms/validators/color
'
;
import
{
validator
as
colorValidator
}
from
'
ui/shared/forms/validators/color
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
PublicTagsSubmitFieldTagColor
from
'
./PublicTagsSubmitFieldTagColor
'
;
import
PublicTagsSubmitFieldTagType
from
'
./PublicTagsSubmitFieldTagType
'
;
import
PublicTagsSubmitFieldTagType
from
'
./PublicTagsSubmitFieldTagType
'
;
const
CIRCLE_BG_COLOR_DEFAULT
=
{
bgColor
:
{
_light
:
'
gray.100
'
,
_dark
:
'
gray.700
'
},
textColor
:
{
_light
:
'
blackAlpha.800
'
,
_dark
:
'
whiteAlpha.800
'
},
};
interface
Props
{
interface
Props
{
index
:
number
;
index
:
number
;
field
:
FormFieldTag
;
field
:
FormFieldTag
;
...
@@ -27,8 +33,8 @@ interface Props {
...
@@ -27,8 +33,8 @@ interface Props {
const
PublicTagsSubmitFieldTag
=
({
index
,
isDisabled
,
errors
,
onAddClick
,
onRemoveClick
,
tagTypes
,
field
}:
Props
)
=>
{
const
PublicTagsSubmitFieldTag
=
({
index
,
isDisabled
,
errors
,
onAddClick
,
onRemoveClick
,
tagTypes
,
field
}:
Props
)
=>
{
const
isMobile
=
useIsMobile
();
const
isMobile
=
useIsMobile
();
const
bgColorDefault
=
useColorModeValue
(
'
blackAlpha.50
'
,
'
whiteAlpha.100
'
)
;
const
bgColorDefault
=
{
_light
:
'
blackAlpha.50
'
,
_dark
:
'
whiteAlpha.100
'
}
;
const
bgColorError
=
useColorModeValue
(
'
red.50
'
,
'
red.900
'
)
;
const
bgColorError
=
{
_light
:
'
red.50
'
,
_dark
:
'
red.900
'
}
;
const
handleAddClick
=
React
.
useCallback
(()
=>
{
const
handleAddClick
=
React
.
useCallback
(()
=>
{
onAddClick
?.(
index
);
onAddClick
?.(
index
);
...
@@ -38,10 +44,6 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
...
@@ -38,10 +44,6 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
onRemoveClick
?.(
index
);
onRemoveClick
?.(
index
);
},
[
index
,
onRemoveClick
]);
},
[
index
,
onRemoveClick
]);
const
fieldProps
=
{
size
:
{
base
:
'
md
'
,
lg
:
'
lg
'
},
};
return
(
return
(
<>
<>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
p=
"10px"
borderRadius=
"base"
bgColor=
{
errors
?
bgColorError
:
bgColorDefault
}
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
p=
"10px"
borderRadius=
"base"
bgColor=
{
errors
?
bgColorError
:
bgColorDefault
}
>
...
@@ -54,9 +56,8 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
...
@@ -54,9 +56,8 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
<
FormFieldText
<
FormFields
>
<
FormFieldText
<
FormFields
>
name=
{
`tags.${ index }.name`
}
name=
{
`tags.${ index }.name`
}
placeholder="Tag (max 35 characters)"
placeholder="Tag (max 35 characters)"
isR
equired
r
equired
rules=
{
{
maxLength
:
35
}
}
rules=
{
{
maxLength
:
35
}
}
{
...
fieldProps
}
/
>
/
>
</
GridItem
>
</
GridItem
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
...
@@ -66,20 +67,17 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
...
@@ -66,20 +67,17 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
<
FormFieldUrl
<
FormFields
>
<
FormFieldUrl
<
FormFields
>
name=
{
`tags.${ index }.url`
}
name=
{
`tags.${ index }.url`
}
placeholder="Label URL"
placeholder="Label URL"
{
...
fieldProps
}
/
>
/
>
</
GridItem
>
</
GridItem
>
<
PublicTagsSubmitFieldTagColor
<
FormFieldColor
<
FormFields
>
fieldType=
"bgColor"
name=
{
`tags.${ index }.bgColor`
}
fieldName=
{
`tags.${ index }.bgColor`
}
placeholder="Background (Hex)"
placeholder="Background (Hex)"
error=
{
errors
?
.
bgColor
}
sampleDefaultBgColor=
{
CIRCLE_BG_COLOR_DEFAULT
.
bgColor
}
/
>
/
>
<
PublicTagsSubmitFieldTagColor
<
FormFieldColor
<
FormFields
>
fieldType=
"textColor"
name=
{
`tags.${ index }.textColor`
}
fieldName=
{
`tags.${ index }.textColor`
}
placeholder="Text (Hex)"
placeholder="Text (Hex)"
error=
{
errors
?
.
textColor
}
sampleDefaultBgColor=
{
CIRCLE_BG_COLOR_DEFAULT
.
textColor
}
/
>
/
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
4
}
}
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
4
}
}
>
<
FormFieldText
<
FormFields
>
<
FormFieldText
<
FormFields
>
...
@@ -88,7 +86,6 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
...
@@ -88,7 +86,6 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
maxH="160px"
maxH="160px"
rules=
{
{
maxLength
:
80
}
}
rules=
{
{
maxLength
:
80
}
}
asComponent="Textarea"
asComponent="Textarea"
{
...
fieldProps
}
/
>
/
>
</
GridItem
>
</
GridItem
>
</
Grid
>
</
Grid
>
...
@@ -107,9 +104,10 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
...
@@ -107,9 +104,10 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
variant=
"outline"
variant=
"outline"
boxSize=
"30px"
boxSize=
"30px"
onClick=
{
handleAddClick
}
onClick=
{
handleAddClick
}
icon=
{
<
IconSvg
name=
"plus"
boxSize=
{
5
}
/>
}
disabled=
{
isDisabled
}
isDisabled=
{
isDisabled
}
>
/>
<
IconSvg
name=
"plus"
boxSize=
{
5
}
/>
</
IconButton
>
)
}
)
}
{
onRemoveClick
&&
(
{
onRemoveClick
&&
(
<
IconButton
<
IconButton
...
@@ -118,16 +116,17 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
...
@@ -118,16 +116,17 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
variant=
"outline"
variant=
"outline"
boxSize=
"30px"
boxSize=
"30px"
onClick=
{
handleRemoveClick
}
onClick=
{
handleRemoveClick
}
icon=
{
<
IconSvg
name=
"minus"
boxSize=
{
5
}
/>
}
disabled=
{
isDisabled
}
isDisabled=
{
isDisabled
}
>
/>
<
IconSvg
name=
"minus"
boxSize=
{
5
}
/>
</
IconButton
>
)
}
)
}
</
Flex
>
</
Flex
>
{
!
isMobile
&&
(
{
!
isMobile
&&
(
<
Flex
flexDir=
"column"
alignItems=
"flex-start"
mt=
{
10
}
rowGap=
{
2
}
>
<
Flex
flexDir=
"column"
alignItems=
"flex-start"
mt=
{
10
}
rowGap=
{
2
}
>
<
EntityTag
data=
{
{
<
EntityTag
data=
{
{
name
:
field
.
name
||
'
Tag name
'
,
name
:
field
.
name
||
'
Tag name
'
,
tagType
:
field
.
type
.
value
,
tagType
:
field
.
type
[
0
]
.
value
,
meta
:
{
meta
:
{
tagUrl
:
field
.
url
,
tagUrl
:
field
.
url
,
bgColor
:
field
.
bgColor
&&
colorValidator
(
field
.
bgColor
)
===
true
?
field
.
bgColor
:
undefined
,
bgColor
:
field
.
bgColor
&&
colorValidator
(
field
.
bgColor
)
===
true
?
field
.
bgColor
:
undefined
,
...
@@ -138,7 +137,7 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
...
@@ -138,7 +137,7 @@ const PublicTagsSubmitFieldTag = ({ index, isDisabled, errors, onAddClick, onRem
ordinal
:
0
,
ordinal
:
0
,
}
}
/>
}
}
/>
<
chakra
.
span
color=
"text_secondary"
fontSize=
"sm"
>
<
chakra
.
span
color=
"text_secondary"
fontSize=
"sm"
>
{
tagTypes
?.
find
(({
type
})
=>
type
===
field
.
type
.
value
)?.
description
}
{
tagTypes
?.
find
(({
type
})
=>
type
===
field
.
type
[
0
]
.
value
)?.
description
}
</
chakra
.
span
>
</
chakra
.
span
>
</
Flex
>
</
Flex
>
)
}
)
}
...
...
ui/publicTags/submit/fields/PublicTagsSubmitFieldTagColor.tsx
deleted
100644 → 0
View file @
b8789b81
import
{
Circle
,
FormControl
,
Input
,
InputGroup
,
InputRightElement
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
useFormContext
,
type
FieldError
}
from
'
react-hook-form
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
FormInputPlaceholder
from
'
ui/shared/forms/inputs/FormInputPlaceholder
'
;
import
{
validator
as
colorValidator
}
from
'
ui/shared/forms/validators/color
'
;
type
ColorFieldTypes
=
'
bgColor
'
|
'
textColor
'
;
interface
Props
<
Type
extends
ColorFieldTypes
>
{
fieldType
:
Type
;
fieldName
:
`tags.
${
number
}
.
${
Type
}
`
;
error
:
FieldError
|
undefined
;
placeholder
:
string
;
}
const
PublicTagsSubmitFieldTagColor
=
<
Type
extends
ColorFieldTypes
>
(
{
error
,
fieldName
,
placeholder
,
fieldType
}
: Props
<
Type
>
) =
>
{
const
{
register
,
formState
}
=
useFormContext
<
FormFields
>
();
const
isDisabled
=
formState
.
isSubmitting
;
const
circleBgColorDefault
=
{
bgColor
:
useColorModeValue
(
'
gray.100
'
,
'
gray.700
'
),
textColor
:
useColorModeValue
(
'
blackAlpha.800
'
,
'
whiteAlpha.800
'
),
};
const
isMobile
=
useIsMobile
();
const
field
=
register
(
fieldName
,
{
validate
:
colorValidator
,
maxLength
:
7
});
const
[
value
,
setValue
]
=
React
.
useState
(
''
);
const
handleChange
=
React
.
useCallback
((
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
nextValue
=
(()
=>
{
const
value
=
event
.
target
.
value
;
if
(
value
)
{
if
(
value
.
length
===
1
&&
value
[
0
]
!==
'
#
'
)
{
return
`#${ value }`
;
}
}
return
value
;
})();
setValue
(
nextValue
);
field
.
onChange
(
event
);
},
[
field
]);
return
(
<
FormControl
variant=
"floating"
size=
{
{
base
:
'
md
'
,
lg
:
'
lg
'
}
}
>
<
InputGroup
size=
{
isMobile
?
'
md
'
:
'
lg
'
}
>
<
Input
{
...
field
}
onChange=
{
handleChange
}
value=
{
value
}
isInvalid=
{
Boolean
(
error
)
}
isDisabled=
{
isDisabled
}
autoComplete=
"off"
maxLength=
{
7
}
/>
<
FormInputPlaceholder
text=
{
placeholder
}
error=
{
error
}
/>
<
InputRightElement
w=
"30px"
h=
"auto"
right=
{
4
}
top=
"50%"
transform=
"translateY(-50%)"
zIndex=
{
10
}
>
<
Circle
size=
"30px"
bgColor=
{
value
&&
colorValidator
(
value
)
===
true
?
value
:
circleBgColorDefault
[
fieldType
]
}
borderColor=
"gray.300"
borderWidth=
"1px"
/>
</
InputRightElement
>
</
InputGroup
>
</
FormControl
>
);
}
;
export default React.memo(PublicTagsSubmitFieldTagColor);
ui/publicTags/submit/fields/PublicTagsSubmitFieldTagType.tsx
View file @
2c11ad9b
import
{
c
hakra
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
c
reateListCollection
}
from
'
@chakra-ui/react
'
;
import
{
capitalize
}
from
'
es-toolkit
'
;
import
{
capitalize
}
from
'
es-toolkit
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
useFormContext
}
from
'
react-hook-form
'
;
//
import { useFormContext } from 'react-hook-form';
import
type
{
FormFields
}
from
'
../types
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
type
{
PublicTagType
}
from
'
types/api/addressMetadata
'
;
import
type
{
PublicTagType
}
from
'
types/api/addressMetadata
'
;
import
type
{
Option
}
from
'
ui/shared/forms/inputs/select/types
'
;
import
{
chakraComponents
}
from
'
chakra-react-select
'
;
import
FormFieldSelect
from
'
ui/shared/forms/fields/FormFieldSelect
'
;
import
type
{
GroupBase
,
SelectComponentsConfig
,
SingleValueProps
}
from
'
chakra-react-select
'
;
// import IconSvg from 'ui/shared/IconSvg';
import
FormFieldFancySelect
from
'
ui/shared/forms/fields/FormFieldFancySelect
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
interface
Props
{
interface
Props
{
index
:
number
;
index
:
number
;
...
@@ -18,56 +15,58 @@ interface Props {
...
@@ -18,56 +15,58 @@ interface Props {
}
}
const
PublicTagsSubmitFieldTagType
=
({
index
,
tagTypes
}:
Props
)
=>
{
const
PublicTagsSubmitFieldTagType
=
({
index
,
tagTypes
}:
Props
)
=>
{
const
{
watch
}
=
useFormContext
<
FormFields
>
();
//
const { watch } = useFormContext<FormFields>();
const
typeOptions
=
React
.
useMemo
(()
=>
tagTypes
?.
map
((
type
)
=>
({
const
collection
=
React
.
useMemo
(()
=>
{
const
items
=
tagTypes
?.
map
((
type
)
=>
({
value
:
type
.
type
,
value
:
type
.
type
,
label
:
capitalize
(
type
.
type
),
label
:
capitalize
(
type
.
type
),
}))
??
[],
[
tagTypes
])
;
}))
??
[]
;
const
fieldValue
=
watch
(
`tags.
${
index
}
.type`
).
value
;
return
createListCollection
({
items
});
},
[
tagTypes
]);
const
selectComponents
:
SelectComponentsConfig
<
Option
,
boolean
,
GroupBase
<
Option
>>
=
React
.
useMemo
(()
=>
{
// const fieldValue = watch(`tags.${ index }.type`).value;
type
SingleValueComponentProps
=
SingleValueProps
<
Option
,
boolean
,
GroupBase
<
Option
>>
&
{
children
:
React
.
ReactNode
};
const
SingleValue
=
({
children
,
...
props
}:
SingleValueComponentProps
)
=>
{
// TODO @tom2drum: add icon for selected value
switch
(
fieldValue
)
{
// const selectComponents: SelectComponentsConfig<Option, boolean, GroupBase<Option>> = React.useMemo(() => {
case
'
name
'
:
{
// type SingleValueComponentProps = SingleValueProps<Option, boolean, GroupBase<Option>> & { children: React.ReactNode };
return
(
// const SingleValue = ({ children, ...props }: SingleValueComponentProps) => {
<
chakraComponents
.
SingleValue
{
...
props
}
>
// switch (fieldValue) {
<
Flex
alignItems=
"center"
columnGap=
{
1
}
>
// case 'name': {
<
IconSvg
name=
"publictags_slim"
boxSize=
{
4
}
flexShrink=
{
0
}
color=
"gray.400"
/>
// return (
{
children
}
// <chakraComponents.SingleValue { ...props }>
</
Flex
>
// <Flex alignItems="center" columnGap={ 1 }>
</
chakraComponents
.
SingleValue
>
// <IconSvg name="publictags_slim" boxSize={ 4 } flexShrink={ 0 } color="gray.400"/>
);
// { children }
}
// </Flex>
case
'
protocol
'
:
// </chakraComponents.SingleValue>
case
'
generic
'
:
{
// );
return
(
// }
<
chakraComponents
.
SingleValue
{
...
props
}
>
// case 'protocol':
<
chakra
.
span
color=
"gray.400"
>
#
</
chakra
.
span
>
{
children
}
// case 'generic': {
</
chakraComponents
.
SingleValue
>
// return (
);
// <chakraComponents.SingleValue { ...props }>
}
// <chakra.span color="gray.400">#</chakra.span> { children }
// </chakraComponents.SingleValue>
// );
// }
default
:
{
//
default: {
return
(<
chakraComponents
.
SingleValue
{
...
props
}
>
{
children
}
</
chakraComponents
.
SingleValue
>);
//
return (<chakraComponents.SingleValue { ...props }>{ children }</chakraComponents.SingleValue>);
}
//
}
}
//
}
};
//
};
return
{
SingleValue
};
//
return { SingleValue };
},
[
fieldValue
]);
//
}, [ fieldValue ]);
return
(
return
(
<
FormField
Fancy
Select
<
FormFields
,
`
tags
.
$
{
number
}
.
type
`
>
<
FormFieldSelect
<
FormFields
,
`
tags
.
$
{
number
}
.
type
`
>
name=
{
`tags.${ index }.type`
}
name=
{
`tags.${ index }.type`
}
placeholder="Tag type"
placeholder="Tag type"
options=
{
typeOptions
}
collection=
{
collection
}
isRequired
required
isAsync=
{
false
}
isSearchable=
{
false
}
components=
{
selectComponents
}
/
>
/
>
);
);
};
};
...
...
ui/publicTags/submit/fields/PublicTagsSubmitFieldTags.tsx
View file @
2c11ad9b
...
@@ -24,7 +24,7 @@ const PublicTagsSubmitFieldTags = ({ tagTypes }: Props) => {
...
@@ -24,7 +24,7 @@ const PublicTagsSubmitFieldTags = ({ tagTypes }: Props) => {
const
handleAddFieldClick
=
React
.
useCallback
((
index
:
number
)
=>
{
const
handleAddFieldClick
=
React
.
useCallback
((
index
:
number
)
=>
{
insert
(
index
+
1
,
{
insert
(
index
+
1
,
{
name
:
''
,
name
:
''
,
type
:
{
label
:
'
Name
'
,
value
:
'
name
'
}
,
type
:
[
{
label
:
'
Name
'
,
value
:
'
name
'
}
]
,
url
:
undefined
,
url
:
undefined
,
bgColor
:
undefined
,
bgColor
:
undefined
,
textColor
:
undefined
,
textColor
:
undefined
,
...
...
ui/publicTags/submit/types.ts
View file @
2c11ad9b
...
@@ -13,7 +13,7 @@ export interface FormFields {
...
@@ -13,7 +13,7 @@ export interface FormFields {
export
interface
FormFieldTag
{
export
interface
FormFieldTag
{
name
:
string
;
name
:
string
;
type
:
Option
<
AddressMetadataTagType
>
;
type
:
Array
<
Option
<
AddressMetadataTagType
>
>
;
url
:
string
|
undefined
;
url
:
string
|
undefined
;
bgColor
:
string
|
undefined
;
bgColor
:
string
|
undefined
;
textColor
:
string
|
undefined
;
textColor
:
string
|
undefined
;
...
...
ui/publicTags/submit/utils.ts
View file @
2c11ad9b
...
@@ -19,7 +19,7 @@ export function convertFormDataToRequestsBody(data: FormFields): Array<SubmitReq
...
@@ -19,7 +19,7 @@ export function convertFormDataToRequestsBody(data: FormFields): Array<SubmitReq
companyWebsite
:
data
.
companyWebsite
,
companyWebsite
:
data
.
companyWebsite
,
address
:
address
.
hash
,
address
:
address
.
hash
,
name
:
tag
.
name
,
name
:
tag
.
name
,
tagType
:
tag
.
type
.
value
,
tagType
:
tag
.
type
[
0
]
.
value
,
description
:
data
.
description
,
description
:
data
.
description
,
meta
:
pickBy
({
meta
:
pickBy
({
bgColor
:
tag
.
bgColor
,
bgColor
:
tag
.
bgColor
,
...
@@ -37,7 +37,7 @@ export function convertFormDataToRequestsBody(data: FormFields): Array<SubmitReq
...
@@ -37,7 +37,7 @@ export function convertFormDataToRequestsBody(data: FormFields): Array<SubmitReq
export
function
convertTagApiFieldsToFormFields
(
tag
:
Pick
<
SubmitRequestBody
,
'
name
'
|
'
tagType
'
|
'
meta
'
>
):
FormFieldTag
{
export
function
convertTagApiFieldsToFormFields
(
tag
:
Pick
<
SubmitRequestBody
,
'
name
'
|
'
tagType
'
|
'
meta
'
>
):
FormFieldTag
{
return
{
return
{
name
:
tag
.
name
,
name
:
tag
.
name
,
type
:
{
label
:
tag
.
tagType
,
value
:
tag
.
tagType
}
,
type
:
[
{
label
:
tag
.
tagType
,
value
:
tag
.
tagType
}
]
,
url
:
tag
.
meta
.
tagUrl
,
url
:
tag
.
meta
.
tagUrl
,
bgColor
:
tag
.
meta
.
bgColor
,
bgColor
:
tag
.
meta
.
bgColor
,
textColor
:
tag
.
meta
.
textColor
,
textColor
:
tag
.
meta
.
textColor
,
...
@@ -104,7 +104,7 @@ export function getFormDefaultValues(query: Route['query'], userInfo: UserInfo |
...
@@ -104,7 +104,7 @@ export function getFormDefaultValues(query: Route['query'], userInfo: UserInfo |
requesterEmail
:
getQueryParamString
(
query
?.
requesterEmail
)
||
userInfo
?.
email
||
undefined
,
requesterEmail
:
getQueryParamString
(
query
?.
requesterEmail
)
||
userInfo
?.
email
||
undefined
,
companyName
:
getQueryParamString
(
query
?.
companyName
),
companyName
:
getQueryParamString
(
query
?.
companyName
),
companyWebsite
:
getQueryParamString
(
query
?.
companyWebsite
),
companyWebsite
:
getQueryParamString
(
query
?.
companyWebsite
),
tags
:
[
{
name
:
''
,
type
:
{
label
:
'
Name
'
,
value
:
'
name
'
as
const
}
}
],
tags
:
[
{
name
:
''
,
type
:
[
{
label
:
'
Name
'
,
value
:
'
name
'
as
const
}
]
}
],
};
};
}
}
...
...
ui/shared/forms/fields/FormFieldColor.tsx
0 → 100644
View file @
2c11ad9b
import
type
{
BoxProps
}
from
'
@chakra-ui/react
'
;
import
{
Circle
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
FieldValues
,
Path
}
from
'
react-hook-form
'
;
import
{
useController
,
useFormContext
}
from
'
react-hook-form
'
;
import
type
{
FormFieldPropsBase
}
from
'
./types
'
;
import
{
Field
}
from
'
toolkit/chakra/field
'
;
import
type
{
InputProps
}
from
'
toolkit/chakra/input
'
;
import
{
Input
}
from
'
toolkit/chakra/input
'
;
import
{
InputGroup
}
from
'
toolkit/chakra/input-group
'
;
import
{
validator
as
colorValidator
}
from
'
ui/shared/forms/validators/color
'
;
import
getFieldErrorText
from
'
../utils/getFieldErrorText
'
;
interface
Props
<
FormFields
extends
FieldValues
,
Name
extends
Path
<
FormFields
>
=
Path
<
FormFields
>
,
>
extends
FormFieldPropsBase
<
FormFields
,
Name
>
{
sampleDefaultBgColor
?:
BoxProps
[
'
bgColor
'
];
}
const
FormFieldColor
=
<
FormFields
extends
FieldValues
,
Name
extends
Path
<
FormFields
>
= Path
<
FormFields
>
,
>
(
{
name
,
placeholder
,
rules
,
onBlur
,
group
,
inputProps
,
size
=
'
xl
'
,
disabled
,
sampleDefaultBgColor
,
...
restProps
}
: Props
<
FormFields
,
Name
>
) =
>
{
const
{
control
}
=
useFormContext
<
FormFields
>
();
const
{
field
,
fieldState
,
formState
}
=
useController
<
FormFields
,
typeof
name
>
({
control
,
name
,
rules
:
{
...
rules
,
required
:
restProps
.
required
,
validate
:
colorValidator
,
maxLength
:
7
,
},
});
const
[
value
,
setValue
]
=
React
.
useState
(
''
);
const
handleChange
=
React
.
useCallback
((
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
nextValue
=
(()
=>
{
const
value
=
event
.
target
.
value
;
if
(
value
)
{
if
(
value
.
length
===
1
&&
value
[
0
]
!==
'
#
'
)
{
return
`#${ value }`
;
}
}
return
value
;
})();
setValue
(
nextValue
);
field
.
onChange
(
nextValue
);
},
[
field
]);
const
handleBlur
=
React
.
useCallback
(()
=>
{
field
.
onBlur
();
onBlur
?.();
},
[
field
,
onBlur
]);
const
endElement
=
(
<
Circle
size=
"30px"
bgColor=
{
field
.
value
&&
colorValidator
(
field
.
value
)
===
true
?
field
.
value
:
sampleDefaultBgColor
}
borderColor=
"gray.300"
borderWidth=
"1px"
mx=
"15px"
/>
);
return
(
<
Field
label=
{
placeholder
}
errorText=
{
getFieldErrorText
(
fieldState
.
error
)
}
invalid=
{
Boolean
(
fieldState
.
error
)
}
disabled=
{
formState
.
isSubmitting
||
disabled
}
size=
{
size
}
floating
{
...
restProps
}
>
<
InputGroup
{
...
group
}
endElement=
{
endElement
}
>
<
Input
{
...
field
}
autoComplete=
"off"
onBlur=
{
handleBlur
}
onChange=
{
handleChange
}
value=
{
value
}
{
...
inputProps
as
InputProps
}
/>
</
InputGroup
>
</
Field
>
);
}
;
export default React.memo(FormFieldColor) as typeof FormFieldColor;
ui/shared/forms/fields/FormFieldText.tsx
View file @
2c11ad9b
...
@@ -31,7 +31,7 @@ const FormFieldText = <
...
@@ -31,7 +31,7 @@ const FormFieldText = <
group
,
group
,
inputProps
,
inputProps
,
asComponent
,
asComponent
,
size
=
'
xl
'
,
size
=
asComponent
===
'
Textarea
'
?
'
2xl
'
:
'
xl
'
,
disabled
,
disabled
,
...
restProps
...
restProps
}
: Props
<
FormFields
,
Name
>
) =
>
{
}
: Props
<
FormFields
,
Name
>
) =
>
{
...
...
ui/shared/forms/validators/color.ts
View file @
2c11ad9b
export
const
COLOR_HEX_REGEXP
=
/^#
[
a-f
\d]{3,6}
$/i
;
export
const
COLOR_HEX_REGEXP
=
/^#
[
a-f
\d]{3,6}
$/i
;
export
const
validator
=
(
value
:
string
|
undefined
)
=>
{
export
const
validator
=
(
value
:
unknown
)
=>
{
if
(
typeof
value
!==
'
string
'
)
{
return
true
;
}
if
(
!
value
||
value
.
length
===
0
)
{
if
(
!
value
||
value
.
length
===
0
)
{
return
true
;
return
true
;
}
}
...
...
ui/tokenInfo/TokenInfoForm.tsx
View file @
2c11ad9b
...
@@ -115,7 +115,6 @@ const TokenInfoForm = ({ address, tokenName, application, onSubmit }: Props) =>
...
@@ -115,7 +115,6 @@ const TokenInfoForm = ({ address, tokenName, application, onSubmit }: Props) =>
}
}
const
fieldProps
=
{
const
fieldProps
=
{
size
:
'
xl
'
as
const
,
readOnly
:
application
?.
status
===
'
IN_PROCESS
'
,
readOnly
:
application
?.
status
===
'
IN_PROCESS
'
,
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment