Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fcos-suite-map
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fab City OS Suite
fcos-suite-map
Commits
8512d6d9
Commit
8512d6d9
authored
3 years ago
by
Moritz Stückler
Browse files
Options
Downloads
Patches
Plain Diff
fix: convert form checkicon to checkbox
parent
b0d5f025
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Form/AddPoiForm.tsx
+2
-6
2 additions, 6 deletions
src/components/Form/AddPoiForm.tsx
src/components/Form/CheckboxInput.tsx
+21
-0
21 additions, 0 deletions
src/components/Form/CheckboxInput.tsx
with
23 additions
and
6 deletions
src/components/Form/AddPoiForm.tsx
+
2
−
6
View file @
8512d6d9
...
...
@@ -5,9 +5,9 @@ import fetcher from '../../util/fetcher';
import
TextInput
from
'
./TextInput
'
;
import
FileInput
from
'
./FileInput
'
;
import
TextAreaInput
from
'
./TextAreaInput
'
;
import
{
CheckCircleOutline
as
CheckIcon
}
from
'
heroicons-react
'
;
import
{
useStore
}
from
'
../../hooks
'
;
import
{
useHistory
}
from
'
react-router-dom
'
;
import
CheckboxInput
from
'
./CheckboxInput
'
;
interface
Props
{}
...
...
@@ -115,11 +115,7 @@ const AddPoiForm: React.FC<Props> = () => {
return
(
<
form
className
=
"flex flex-col"
onSubmit
=
{
handleSubmit
}
ref
=
{
formRef
}
>
<
p
className
=
"flex items-center leading-relaxed mb-5 text-gray-600"
>
<
CheckIcon
className
=
{
`
${
draftPoi
?
'
text-indigo-500
'
:
'
text-gray-400
'
}
mr-2`
}
/>
Bitte einen Pin auf der Karte setzen.
</
p
>
<
CheckboxInput
name
=
"draft"
label
=
{
'
Bitte einen Pin auf der Karte setzen.
'
}
value
=
{
Boolean
(
draftPoi
)
}
required
/>
<
TextInput
label
=
{
'
Name des Orts
'
}
name
=
{
'
name
'
}
value
=
{
formData
.
name
}
onChange
=
{
handleInputChange
}
required
/>
<
TextInput
label
=
{
'
Kategorie
'
}
...
...
This diff is collapsed.
Click to expand it.
src/components/Form/CheckboxInput.tsx
0 → 100644
+
21
−
0
View file @
8512d6d9
import
React
from
'
react
'
;
import
{
CheckCircleOutline
as
CheckIcon
}
from
'
heroicons-react
'
;
interface
Props
{
label
:
string
;
value
:
boolean
;
name
:
string
;
required
?:
boolean
;
}
const
CheckboxInput
:
React
.
FC
<
Props
>
=
({
name
,
label
,
value
,
...
inputProps
})
=>
{
return
(
<
label
className
=
"flex mb-4 items-center"
>
<
CheckIcon
className
=
{
`
${
value
?
'
text-indigo-500
'
:
'
text-gray-400
'
}
mr-2`
}
/>
<
input
readOnly
type
=
"checkbox"
name
=
{
name
}
value
=
{
name
}
className
=
"hidden"
checked
=
{
value
}
{
...
inputProps
}
/>
{
!!
label
&&
<
span
className
=
"form-label"
>
{
label
}
</
span
>
}
</
label
>
);
};
export
default
CheckboxInput
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment