add utility apps filter for header

fork
Philipp Rothmann 2022-11-15 12:09:10 +01:00
parent b55eb16384
commit 7032b49554
1 changed files with 18 additions and 15 deletions

View File

@ -6,6 +6,7 @@ import Gravatar from 'react-gravatar';
import { Link, useLocation } from 'react-router-dom';
import clsx from 'clsx';
import { useApps } from 'src/services/apps';
import { UTILITY_APPS } from 'src/modules/dashboard/consts';
const navigation = [
{ name: '', to: '/users', requiresAdmin: true },
@ -64,21 +65,23 @@ const HeaderLIT: React.FC<HeaderProps> = () => {
</Link>
<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" */}
{apps.map((app) => (
<Link
key={app.name}
to={app.slug}
className={clsx(
'border-primary-50 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium litbutton',
{
'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>
))}
{apps
.filter((app) => UTILITY_APPS.indexOf(app.slug) === -1)
.map((app) => (
<Link
key={app.name}
to={app.slug}
className={clsx(
'border-primary-50 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium litbutton',
{
'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>
))}
{/* {navigationItems.map((item) => (
<Link
key={item.name}