Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nocobase
Commits
610dd6a9
Commit
610dd6a9
authored
3 years ago
by
Semmy
Browse files
Options
Download
Email Patches
Plain Diff
fix: high light block menu
parent
02ff2961
fix-template-menu
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/client/src/schema-templates/SchemaTemplateShortcut.tsx
+13
-3
...es/client/src/schema-templates/SchemaTemplateShortcut.tsx
with
13 additions
and
3 deletions
+13
-3
packages/client/src/schema-templates/SchemaTemplateShortcut.tsx
+
13
-
3
View file @
610dd6a9
import
{
LayoutOutlined
}
from
'
@ant-design/icons
'
;
import
React
from
'
react
'
;
import
{
useSetState
}
from
'
ahooks
'
;
import
React
,
{
useEffect
}
from
'
react
'
;
import
{
useTranslation
}
from
'
react-i18next
'
;
import
{
useHistory
}
from
'
react-router-dom
'
;
import
{
useHistory
,
useLocation
}
from
'
react-router-dom
'
;
import
{
PluginManager
}
from
'
../plugin-manager
'
;
export
const
SchemaTemplateShortcut
=
()
=>
{
const
{
t
}
=
useTranslation
();
const
location
=
useLocation
();
const
[
style
,
setStyle
]
=
useSetState
({});
const
pathname
=
'
/admin/block-templates
'
;
useEffect
(()
=>
{
setStyle
(
location
.
pathname
.
startsWith
(
pathname
)
?
{
backgroundColor
:
'
#f18b62
'
}
:
{
backgroundColor
:
null
});
},
[
location
.
pathname
]);
const
history
=
useHistory
();
return
(
<
PluginManager
.
Toolbar
.
Item
style
=
{
style
}
icon
=
{
<
LayoutOutlined
/>
}
title
=
{
t
(
'
Block templates
'
)
}
onClick
=
{
()
=>
{
history
.
push
(
'
/admin/block-templates
'
);
history
.
push
(
pathname
);
}
}
/>
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help