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
12efd8b6
Verified
Commit
12efd8b6
authored
6 days ago
by
Moritz Stückler
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove empty category names
parent
eb8c939e
No related branches found
No related tags found
1 merge request
!18
fix: remove empty category names
Pipeline
#11421
passed
6 days ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Map/MapLayerControl.tsx
+3
-2
3 additions, 2 deletions
src/components/Map/MapLayerControl.tsx
src/components/Sidebar/SidebarContainer.tsx
+7
-3
7 additions, 3 deletions
src/components/Sidebar/SidebarContainer.tsx
with
10 additions
and
5 deletions
src/components/Map/MapLayerControl.tsx
+
3
−
2
View file @
12efd8b6
...
...
@@ -5,10 +5,11 @@ import { Pill } from '@fchh/fcos-suite-ui';
const
MapLayerControl
:
React
.
FC
=
()
=>
{
const
data
=
useStore
((
state
)
=>
state
.
poiData
);
const
{
filterCategories
,
setFilterCategories
}
=
useFilteredPoiData
();
const
layers
=
Array
.
from
(
new
Set
(
data
?.
map
((
poi
)
=>
poi
.
category
)));
const
layers
=
Array
.
from
(
new
Set
(
data
?.
map
((
poi
)
=>
poi
.
category
.
trim
()).
filter
(
Boolean
)));
const
onChangePills
=
(
layer
:
string
)
=>
{
const
isFilterActive
=
filterCategories
.
includes
(
layer
);
if
(
isFilterActive
)
{
const
updatedFilters
=
filterCategories
.
filter
((
filter
)
=>
filter
!==
layer
);
setFilterCategories
(
updatedFilters
);
...
...
@@ -19,7 +20,7 @@ const MapLayerControl: React.FC = () => {
return
(
<
div
className
=
"fcmap-order-2 md:fcmap-order-1 fcmap-flex fcmap-items-start fcmap-justify-center md:fcmap-justify-end fcmap-flex-wrap fcmap-gap-[9px] fcmap-pointer-events-auto"
>
{
layers
.
map
((
layer
)
=>
{
{
layers
?
.
map
((
layer
)
=>
{
return
(
<
Pill
key
=
{
layer
}
...
...
This diff is collapsed.
Click to expand it.
src/components/Sidebar/SidebarContainer.tsx
+
7
−
3
View file @
12efd8b6
import
clsx
from
"
clsx
"
;
interface
SidebarContainerProps
{
className
?:
string
;
children
:
React
.
ReactNode
;
...
...
@@ -7,9 +9,11 @@ interface SidebarContainerProps {
const
SidebarContainer
:
React
.
FC
<
SidebarContainerProps
>
=
({
className
,
children
,
clickable
=
true
})
=>
{
return
(
<
aside
className
=
{
`fcmap-w-full md:fcmap-w-[336px] fcmap-h-full fcmap-overflow-y-auto fcmap-z-10
${
clickable
?
'
fcmap-pointer-events-auto
'
:
'
fcmap-pointer-events-none
'
}
${
className
??
''
}
`
}
className
=
{
clsx
(
'
fcmap-w-full md:fcmap-w-[336px] fcmap-h-full fcmap-overflow-y-auto fcmap-z-10
'
,
clickable
?
'
fcmap-pointer-events-auto
'
:
'
fcmap-pointer-events-none
'
,
className
,
)
}
>
<
div
className
=
{
`fcmap-shadow-lg fcmap-w-full fcmap-max-h-full md:sidebar-height fcmap-min-h-min fcmap-bg-white fcmap-box-border fcmap-flex fcmap-flex-col`
}
...
...
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