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
bb6af2d8
Commit
bb6af2d8
authored
May 07, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
description field
parent
4d0d415c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
3 deletions
+42
-3
PublicTagsSubmitForm.tsx
ui/publicTags/submit/PublicTagsSubmitForm.tsx
+8
-2
PublicTagsSubmitFieldAddresses.tsx
...blicTags/submit/fields/PublicTagsSubmitFieldAddresses.tsx
+1
-1
PublicTagsSubmitFieldDescription.tsx
...icTags/submit/fields/PublicTagsSubmitFieldDescription.tsx
+32
-0
types.ts
ui/publicTags/submit/types.ts
+1
-0
No files found.
ui/publicTags/submit/PublicTagsSubmitForm.tsx
View file @
bb6af2d8
...
@@ -9,6 +9,7 @@ import type { PublicTagTypesResponse } from 'types/api/addressMetadata';
...
@@ -9,6 +9,7 @@ import type { PublicTagTypesResponse } from 'types/api/addressMetadata';
import
Hint
from
'
ui/shared/Hint
'
;
import
Hint
from
'
ui/shared/Hint
'
;
import
PublicTagsSubmitFieldAddresses
from
'
./fields/PublicTagsSubmitFieldAddresses
'
;
import
PublicTagsSubmitFieldAddresses
from
'
./fields/PublicTagsSubmitFieldAddresses
'
;
import
PublicTagsSubmitFieldDescription
from
'
./fields/PublicTagsSubmitFieldDescription
'
;
import
PublicTagsSubmitFieldRequesterEmail
from
'
./fields/PublicTagsSubmitFieldRequesterEmail
'
;
import
PublicTagsSubmitFieldRequesterEmail
from
'
./fields/PublicTagsSubmitFieldRequesterEmail
'
;
import
PublicTagsSubmitFieldRequesterName
from
'
./fields/PublicTagsSubmitFieldRequesterName
'
;
import
PublicTagsSubmitFieldRequesterName
from
'
./fields/PublicTagsSubmitFieldRequesterName
'
;
...
@@ -40,7 +41,7 @@ const PublicTagsSubmitForm = ({ config }: Props) => {
...
@@ -40,7 +41,7 @@ const PublicTagsSubmitForm = ({ config }: Props) => {
rowGap=
{
{
base
:
5
,
lg
:
4
}
}
rowGap=
{
{
base
:
5
,
lg
:
4
}
}
templateColumns=
{
{
base
:
'
1fr
'
,
lg
:
'
1fr 1fr minmax(0, 200px)
'
,
xl
:
'
1fr 1fr minmax(0, 250px)
'
}
}
templateColumns=
{
{
base
:
'
1fr
'
,
lg
:
'
1fr 1fr minmax(0, 200px)
'
,
xl
:
'
1fr 1fr minmax(0, 250px)
'
}
}
>
>
<
GridItem
colSpan=
{
3
}
as=
"h2"
textStyle=
"h4"
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
3
}
}
as=
"h2"
textStyle=
"h4"
>
Company info
Company info
</
GridItem
>
</
GridItem
>
<
PublicTagsSubmitFieldRequesterName
/>
<
PublicTagsSubmitFieldRequesterName
/>
...
@@ -50,7 +51,7 @@ const PublicTagsSubmitForm = ({ config }: Props) => {
...
@@ -50,7 +51,7 @@ const PublicTagsSubmitForm = ({ config }: Props) => {
<
chakra
.
div
bgColor=
"blue.100"
h=
{
20
}
/>
<
chakra
.
div
bgColor=
"blue.100"
h=
{
20
}
/>
<
chakra
.
div
bgColor=
"yellow.100"
h=
{
20
}
/>
<
chakra
.
div
bgColor=
"yellow.100"
h=
{
20
}
/>
<
GridItem
colSpan=
{
3
}
as=
"h2"
textStyle=
"h4"
mt=
{
3
}
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
3
}
}
as=
"h2"
textStyle=
"h4"
mt=
{
3
}
>
Public tags/labels
Public tags/labels
<
Hint
label=
"Submit a public tag proposal for our moderation team to review"
ml=
{
1
}
color=
"link"
/>
<
Hint
label=
"Submit a public tag proposal for our moderation team to review"
ml=
{
1
}
color=
"link"
/>
</
GridItem
>
</
GridItem
>
...
@@ -59,6 +60,11 @@ const PublicTagsSubmitForm = ({ config }: Props) => {
...
@@ -59,6 +60,11 @@ const PublicTagsSubmitForm = ({ config }: Props) => {
<
chakra
.
div
bgColor=
"blue.100"
h=
{
20
}
/>
<
chakra
.
div
bgColor=
"blue.100"
h=
{
20
}
/>
<
chakra
.
div
bgColor=
"yellow.100"
h=
{
20
}
/>
<
chakra
.
div
bgColor=
"yellow.100"
h=
{
20
}
/>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
<
PublicTagsSubmitFieldDescription
/>
</
GridItem
>
<
GridItem
/>
<
Button
<
Button
variant=
"solid"
variant=
"solid"
size=
"lg"
size=
"lg"
...
...
ui/publicTags/submit/fields/PublicTagsSubmitFieldAddresses.tsx
View file @
bb6af2d8
...
@@ -58,7 +58,7 @@ const PublicTagsSubmitFieldAddresses = () => {
...
@@ -58,7 +58,7 @@ const PublicTagsSubmitFieldAddresses = () => {
{
fields
.
map
((
field
,
index
)
=>
{
{
fields
.
map
((
field
,
index
)
=>
{
return
(
return
(
<
React
.
Fragment
key=
{
field
.
id
}
>
<
React
.
Fragment
key=
{
field
.
id
}
>
<
GridItem
colSpan=
{
2
}
>
<
GridItem
colSpan=
{
{
base
:
1
,
lg
:
2
}
}
>
<
Controller
<
Controller
name=
{
`addresses.${ index }.hash`
}
name=
{
`addresses.${ index }.hash`
}
control=
{
control
}
control=
{
control
}
...
...
ui/publicTags/submit/fields/PublicTagsSubmitFieldDescription.tsx
0 → 100644
View file @
bb6af2d8
import
{
FormControl
,
Textarea
}
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
MAX_LENGTH
=
80
;
const
PublicTagsSubmitFieldDescription
=
()
=>
{
const
{
control
}
=
useFormContext
<
FormFields
>
();
const
{
field
,
fieldState
,
formState
}
=
useController
<
FormFields
,
'
description
'
>
({
control
,
name
:
'
description
'
,
rules
:
{
maxLength
:
MAX_LENGTH
}
});
const
isDisabled
=
formState
.
isSubmitting
;
return
(
<
FormControl
variant=
"floating"
isDisabled=
{
isDisabled
}
size=
{
{
base
:
'
md
'
,
lg
:
'
lg
'
}
}
>
<
Textarea
{
...
field
}
isInvalid=
{
Boolean
(
fieldState
.
error
)
}
isDisabled=
{
isDisabled
}
autoComplete=
"off"
maxH=
"160px"
maxLength=
{
MAX_LENGTH
}
/>
<
InputPlaceholder
text=
"Any comments for moderation... Specify the reason for adding tags and color preference(s)."
error=
{
fieldState
.
error
}
/>
</
FormControl
>
);
};
export
default
React
.
memo
(
PublicTagsSubmitFieldDescription
);
ui/publicTags/submit/types.ts
View file @
bb6af2d8
...
@@ -2,4 +2,5 @@ export interface FormFields {
...
@@ -2,4 +2,5 @@ export interface FormFields {
requesterName
:
string
;
requesterName
:
string
;
requesterEmail
:
string
;
requesterEmail
:
string
;
addresses
:
Array
<
{
hash
:
string
}
>
;
addresses
:
Array
<
{
hash
:
string
}
>
;
description
:
string
;
}
}
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