add utility apps filter for header
This commit is contained in:
parent
b55eb16384
commit
7032b49554
1 changed files with 18 additions and 15 deletions
|
@ -6,6 +6,7 @@ import Gravatar from 'react-gravatar';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { useApps } from 'src/services/apps';
|
import { useApps } from 'src/services/apps';
|
||||||
|
import { UTILITY_APPS } from 'src/modules/dashboard/consts';
|
||||||
|
|
||||||
const navigation = [
|
const navigation = [
|
||||||
{ name: '', to: '/users', requiresAdmin: true },
|
{ name: '', to: '/users', requiresAdmin: true },
|
||||||
|
@ -64,21 +65,23 @@ const HeaderLIT: React.FC<HeaderProps> = () => {
|
||||||
</Link>
|
</Link>
|
||||||
<div className="hidden sm:ml-6 sm:flex sm:space-x-8">
|
<div className="hidden sm:ml-6 sm:flex sm:space-x-8">
|
||||||
{/* Current: "border-primary-500 text-gray-900", Default: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700" */}
|
{/* Current: "border-primary-500 text-gray-900", Default: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700" */}
|
||||||
{apps.map((app) => (
|
{apps
|
||||||
<Link
|
.filter((app) => UTILITY_APPS.indexOf(app.slug) === -1)
|
||||||
key={app.name}
|
.map((app) => (
|
||||||
to={app.slug}
|
<Link
|
||||||
className={clsx(
|
key={app.name}
|
||||||
'border-primary-50 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium litbutton',
|
to={app.slug}
|
||||||
{
|
className={clsx(
|
||||||
'border-primary-500 litbutton-active hover:border-gray-300 inline-flex items-center px-1 pt-1 text-sm font-medium':
|
'border-primary-50 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium litbutton',
|
||||||
pathname.includes(app.slug),
|
{
|
||||||
},
|
'border-primary-500 litbutton-active hover:border-gray-300 inline-flex items-center px-1 pt-1 text-sm font-medium':
|
||||||
)}
|
pathname.includes(app.slug),
|
||||||
>
|
},
|
||||||
{app.name}
|
)}
|
||||||
</Link>
|
>
|
||||||
))}
|
{app.name}
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
{/* {navigationItems.map((item) => (
|
{/* {navigationItems.map((item) => (
|
||||||
<Link
|
<Link
|
||||||
key={item.name}
|
key={item.name}
|
||||||
|
|
Loading…
Reference in a new issue