Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Gatsby Theme Onegeo
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OneGeo Suite
Libs
Gatsby Theme Onegeo
Commits
a5ec58f6
Commit
a5ec58f6
authored
Apr 6, 2023
by
Julien MARGAIL
Browse files
Options
Downloads
Patches
Plain Diff
fix Menu (0.7.2)
parent
9f2cbf93
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
index.d.ts
+1
-0
1 addition, 0 deletions
index.d.ts
src/components/core/Link.tsx
+1
-0
1 addition, 0 deletions
src/components/core/Link.tsx
src/components/core/Menu.tsx
+12
-18
12 additions, 18 deletions
src/components/core/Menu.tsx
with
15 additions
and
18 deletions
CHANGELOG.md
+
1
−
0
View file @
a5ec58f6
...
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
### Added
-
Hero add options.class
-
Hero add options.class
-
Menu fix check type 'page' / 'url', add target blank for external links
-
Update @onegeo-suite/gatsby-plugin-auth to 0.2.1
-
Update @onegeo-suite/gatsby-plugin-auth to 0.2.1
## [0.7.1] - 2023-04-04
## [0.7.1] - 2023-04-04
...
...
...
...
This diff is collapsed.
Click to expand it.
index.d.ts
+
1
−
0
View file @
a5ec58f6
...
@@ -92,6 +92,7 @@ interface LinkProps {
...
@@ -92,6 +92,7 @@ interface LinkProps {
partiallyActive
?:
string
partiallyActive
?:
string
onClick
?:
any
onClick
?:
any
className
?:
any
className
?:
any
target
?:
string
}
}
export
function
Link
(
props
:
LinkProps
):
JSX
.
Element
export
function
Link
(
props
:
LinkProps
):
JSX
.
Element
...
...
...
...
This diff is collapsed.
Click to expand it.
src/components/core/Link.tsx
+
1
−
0
View file @
a5ec58f6
...
@@ -10,6 +10,7 @@ interface Props {
...
@@ -10,6 +10,7 @@ interface Props {
partiallyActive
?:
any
partiallyActive
?:
any
onClick
?:
any
onClick
?:
any
className
?:
any
className
?:
any
target
?:
string
}
}
// Since DOM elements <a> cannot receive activeClassName
// Since DOM elements <a> cannot receive activeClassName
...
...
...
...
This diff is collapsed.
Click to expand it.
src/components/core/Menu.tsx
+
12
−
18
View file @
a5ec58f6
...
@@ -15,6 +15,7 @@ const Menu = (props: Imenu) => {
...
@@ -15,6 +15,7 @@ const Menu = (props: Imenu) => {
const
data
=
useStaticQuery
(
graphql
`
const
data
=
useStaticQuery
(
graphql
`
fragment MenuItem on DirectusData_menus {
fragment MenuItem on DirectusData_menus {
name
name
type
url
url
page {
page {
slug
slug
...
@@ -50,21 +51,22 @@ const Menu = (props: Imenu) => {
...
@@ -50,21 +51,22 @@ const Menu = (props: Imenu) => {
(
menu
:
any
)
=>
name
?.
toLowerCase
()
===
menu
.
name
?.
toLowerCase
()
(
menu
:
any
)
=>
name
?.
toLowerCase
()
===
menu
.
name
?.
toLowerCase
()
)?.
children
||
[]
)?.
children
||
[]
const
goto
=
(
item
)
=>
{
if
(
!
item
)
return
"
/
"
if
(
item
?.
type
===
"
page
"
)
{
const
slug
=
item
?.
page
?.
slug
||
""
if
(
slug
.
at
(
0
)
===
"
/
"
)
return
slug
return
"
/
"
+
slug
}
return
item
.
url
}
const
items
=
(
item
:
any
)
=>
{
const
items
=
(
item
:
any
)
=>
{
return
(
return
(
<
ul
className
=
"bg-base-100 z-50 p-2 shadow-md"
>
<
ul
className
=
"bg-base-100 z-50 p-2 shadow-md"
>
{
item
.
children
.
map
((
itemChild
:
any
,
idx
:
number
)
=>
{
{
item
.
children
.
map
((
itemChild
:
any
,
idx
:
number
)
=>
{
return
(
return
(
<
li
key
=
{
idx
}
>
<
li
key
=
{
idx
}
>
<
Link
<
Link
to
=
{
goto
(
itemChild
)
}
target
=
"_blank"
>
to
=
{
itemChild
.
url
?
itemChild
.
url
:
itemChild
.
page
?.
slug
?
itemChild
.
page
?.
slug
:
"
#
"
}
>
{
itemChild
.
name
}
{
itemChild
.
name
}
</
Link
>
</
Link
>
{
itemChild
?.
children
?.
length
>
0
&&
{
itemChild
?.
children
?.
length
>
0
&&
...
@@ -83,15 +85,7 @@ const Menu = (props: Imenu) => {
...
@@ -83,15 +85,7 @@ const Menu = (props: Imenu) => {
{
menu
?.
map
((
item
:
any
,
key
:
number
)
=>
{
{
menu
?.
map
((
item
:
any
,
key
:
number
)
=>
{
return
(
return
(
<
li
key
=
{
key
}
>
<
li
key
=
{
key
}
>
<
Link
<
Link
to
=
{
goto
(
item
)
}
target
=
"_blank"
>
to
=
{
item
.
url
?
item
.
url
:
item
.
page
?.
slug
?
item
.
page
?.
slug
:
"
#
"
}
>
{
item
.
name
}
{
item
.
name
}
{
item
?.
children
.
length
>
0
&&
(
{
item
?.
children
.
length
>
0
&&
(
<
svg
<
svg
...
...
...
...
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