Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Block Explorer UI
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
Container 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
hive
Block Explorer UI
Commits
aa3fb987
Commit
aa3fb987
authored
4 months ago
by
Lukas
Browse files
Options
Downloads
Patches
Plain Diff
Create post type selector component
parent
b9fff2b8
No related branches found
No related tags found
1 merge request
!508
Lbudginas/#407 add comment type filter
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/home/searches/PostTypeSelector.tsx
+38
-0
38 additions, 0 deletions
components/home/searches/PostTypeSelector.tsx
with
38 additions
and
0 deletions
components/home/searches/PostTypeSelector.tsx
0 → 100644
+
38
−
0
View file @
aa3fb987
import
{
ChangeEventHandler
}
from
"
react
"
;
import
Explorer
from
"
@/types/Explorer
"
;
const
COMMENT_TYPES
=
[
"
all
"
,
"
post
"
,
"
comment
"
];
interface
PostTypeSelectorProps
{
showLabel
?:
boolean
|
undefined
;
handleChange
:
ChangeEventHandler
<
HTMLSelectElement
>
;
commentType
:
Explorer
.
CommentType
;
}
const
PostTypeSelector
:
React
.
FC
<
PostTypeSelectorProps
>
=
({
showLabel
=
false
,
handleChange
,
commentType
,
})
=>
{
return
(
<
div
className
=
"flex flex-col gap-2"
>
{
showLabel
&&
<
label
>
Select comment type
</
label
>
}
<
select
onChange
=
{
handleChange
}
value
=
{
commentType
}
className
=
"border p-2 rounded bg-theme text-text"
>
{
COMMENT_TYPES
.
map
((
type
,
index
)
=>
(
<
option
key
=
{
index
}
value
=
{
type
}
>
{
type
.
charAt
(
0
).
toUpperCase
()
+
type
.
slice
(
1
)
}
</
option
>
))
}
</
select
>
</
div
>
);
};
export
default
PostTypeSelector
;
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