mirror of
https://github.com/WenPai-org/wpmind.git
synced 2025-08-03 19:19:46 +08:00
added Discussions URL
This commit is contained in:
parent
fd171a3738
commit
94d7d976ad
4 changed files with 24 additions and 6 deletions
|
@ -80,6 +80,13 @@ class Mind_Admin {
|
|||
'manage_options',
|
||||
'admin.php?page=mind&sub_page=settings'
|
||||
);
|
||||
add_submenu_page(
|
||||
'mind',
|
||||
'',
|
||||
esc_html__( 'Discussions', 'mind' ),
|
||||
'manage_options',
|
||||
'https://github.com/nk-crew/mind/discussions'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -85,18 +85,23 @@ function PageWrapper() {
|
|||
Object.keys(pages).forEach((k) => {
|
||||
resultTabs.push(
|
||||
<li key={k}>
|
||||
{/* eslint-disable-next-line react/button-has-type */}
|
||||
<button
|
||||
<a
|
||||
href={(pages[k] && pages[k].href) || '#'}
|
||||
target={pages[k] && pages[k].href ? '_blank' : null}
|
||||
rel="noreferrer"
|
||||
className={clsx(
|
||||
'mind-admin-tabs-button',
|
||||
activePage === k && 'mind-admin-tabs-button-active'
|
||||
)}
|
||||
onClick={() => {
|
||||
setActivePage(k);
|
||||
onClick={(e) => {
|
||||
if (pages[k] && !pages[k].href) {
|
||||
e.preventDefault();
|
||||
setActivePage(k);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{pages[k].label}
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
});
|
||||
|
|
|
@ -18,4 +18,8 @@ export default {
|
|||
label: __('Settings', 'mind'),
|
||||
block: PageSettings,
|
||||
},
|
||||
discussions: {
|
||||
label: __('Discussions', 'mind'),
|
||||
href: 'https://github.com/nk-crew/mind/discussions',
|
||||
},
|
||||
};
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
margin: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
a {
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
margin: 0 2px;
|
||||
|
@ -98,6 +98,8 @@
|
|||
background: none;
|
||||
border: none;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue