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
6ff33e9a
Commit
6ff33e9a
authored
May 09, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
company name and website fields
parent
cd328318
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
4 deletions
+65
-4
PublicTagsSubmitForm.tsx
ui/publicTags/submit/PublicTagsSubmitForm.tsx
+5
-3
PublicTagsSubmitFieldCompanyName.tsx
...icTags/submit/fields/PublicTagsSubmitFieldCompanyName.tsx
+28
-0
PublicTagsSubmitFieldCompanyWebsite.tsx
...ags/submit/fields/PublicTagsSubmitFieldCompanyWebsite.tsx
+29
-0
types.ts
ui/publicTags/submit/types.ts
+3
-1
No files found.
ui/publicTags/submit/PublicTagsSubmitForm.tsx
View file @
6ff33e9a
...
...
@@ -9,6 +9,8 @@ import type { PublicTagTypesResponse } from 'types/api/addressMetadata';
import
Hint
from
'
ui/shared/Hint
'
;
import
PublicTagsSubmitFieldAddresses
from
'
./fields/PublicTagsSubmitFieldAddresses
'
;
import
PublicTagsSubmitFieldCompanyName
from
'
./fields/PublicTagsSubmitFieldCompanyName
'
;
import
PublicTagsSubmitFieldCompanyWebsite
from
'
./fields/PublicTagsSubmitFieldCompanyWebsite
'
;
import
PublicTagsSubmitFieldDescription
from
'
./fields/PublicTagsSubmitFieldDescription
'
;
import
PublicTagsSubmitFieldRequesterEmail
from
'
./fields/PublicTagsSubmitFieldRequesterEmail
'
;
import
PublicTagsSubmitFieldRequesterName
from
'
./fields/PublicTagsSubmitFieldRequesterName
'
;
...
...
@@ -23,7 +25,7 @@ const PublicTagsSubmitForm = ({ config }: Props) => {
mode
:
'
onBlur
'
,
defaultValues
:
{
addresses
:
[
{
hash
:
''
}
],
tags
:
[
{
name
:
''
,
type
:
{
label
:
'
name
'
,
value
:
'
name
'
}
,
url
:
undefined
,
bgColor
:
undefined
,
textColor
:
undefined
}
],
tags
:
[
{
name
:
''
,
type
:
{
label
:
'
name
'
,
value
:
'
name
'
}
}
],
},
});
...
...
@@ -47,10 +49,10 @@ const PublicTagsSubmitForm = ({ config }: Props) => {
Company info
</
GridItem
>
<
PublicTagsSubmitFieldRequesterName
/>
<
chakra
.
div
bgColor=
"blue.100"
h=
{
20
}
/>
<
PublicTagsSubmitFieldCompanyName
/>
<
div
/>
<
PublicTagsSubmitFieldRequesterEmail
/>
<
chakra
.
div
bgColor=
"blue.100"
h=
{
20
}
/>
<
PublicTagsSubmitFieldCompanyWebsite
/>
<
div
/>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
3
}
}
as=
"h2"
textStyle=
"h4"
mt=
{
3
}
>
...
...
ui/publicTags/submit/fields/PublicTagsSubmitFieldCompanyName.tsx
0 → 100644
View file @
6ff33e9a
import
{
FormControl
,
Input
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
useController
,
useFormContext
}
from
'
react-hook-form
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
InputPlaceholder
from
'
ui/shared/InputPlaceholder
'
;
const
PublicTagsSubmitFieldCompanyName
=
()
=>
{
const
{
control
}
=
useFormContext
<
FormFields
>
();
const
{
field
,
fieldState
,
formState
}
=
useController
<
FormFields
,
'
companyName
'
>
({
control
,
name
:
'
companyName
'
});
const
isDisabled
=
formState
.
isSubmitting
;
return
(
<
FormControl
variant=
"floating"
isDisabled=
{
isDisabled
}
size=
{
{
base
:
'
md
'
,
lg
:
'
lg
'
}
}
>
<
Input
{
...
field
}
isInvalid=
{
Boolean
(
fieldState
.
error
)
}
isDisabled=
{
isDisabled
}
autoComplete=
"off"
/>
<
InputPlaceholder
text=
"Company name"
error=
{
fieldState
.
error
}
/>
</
FormControl
>
);
};
export
default
React
.
memo
(
PublicTagsSubmitFieldCompanyName
);
ui/publicTags/submit/fields/PublicTagsSubmitFieldCompanyWebsite.tsx
0 → 100644
View file @
6ff33e9a
import
{
FormControl
,
Input
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
useController
,
useFormContext
}
from
'
react-hook-form
'
;
import
type
{
FormFields
}
from
'
../types
'
;
import
{
validator
as
urlValidator
}
from
'
lib/validations/url
'
;
import
InputPlaceholder
from
'
ui/shared/InputPlaceholder
'
;
const
PublicTagsSubmitFieldCompanyWebsite
=
()
=>
{
const
{
control
}
=
useFormContext
<
FormFields
>
();
const
{
field
,
fieldState
,
formState
}
=
useController
<
FormFields
,
'
companyWebsite
'
>
({
control
,
name
:
'
companyWebsite
'
,
rules
:
{
validate
:
urlValidator
}
});
const
isDisabled
=
formState
.
isSubmitting
;
return
(
<
FormControl
variant=
"floating"
isDisabled=
{
isDisabled
}
size=
{
{
base
:
'
md
'
,
lg
:
'
lg
'
}
}
>
<
Input
{
...
field
}
isInvalid=
{
Boolean
(
fieldState
.
error
)
}
isDisabled=
{
isDisabled
}
autoComplete=
"off"
/>
<
InputPlaceholder
text=
"Company website"
error=
{
fieldState
.
error
}
/>
</
FormControl
>
);
};
export
default
React
.
memo
(
PublicTagsSubmitFieldCompanyWebsite
);
ui/publicTags/submit/types.ts
View file @
6ff33e9a
...
...
@@ -3,9 +3,11 @@ import type { AddressMetadataTagType } from 'types/api/addressMetadata';
export
interface
FormFields
{
requesterName
:
string
;
requesterEmail
:
string
;
companyName
:
string
|
undefined
;
companyWebsite
:
string
|
undefined
;
addresses
:
Array
<
{
hash
:
string
}
>
;
tags
:
Array
<
FormFieldTag
>
;
description
:
string
;
description
:
string
|
undefined
;
}
export
interface
FormFieldTag
{
...
...
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