|
|
@ -8,13 +8,14 @@ import MapIcon from '../icons/map.svg'; |
|
|
|
import GroupIcon from '../icons/group.svg'; |
|
|
|
import GroupIcon from '../icons/group.svg'; |
|
|
|
import { useState } from 'preact/hooks'; |
|
|
|
import { useState } from 'preact/hooks'; |
|
|
|
import { useStore } from '@nanostores/preact'; |
|
|
|
import { useStore } from '@nanostores/preact'; |
|
|
|
import { $canManageCurrentTeam } from '../stores/team'; |
|
|
|
import { $canManageCurrentTeam, $currentTeam } from '../stores/team'; |
|
|
|
|
|
|
|
import { WarningIcon } from './ReactIcons/WarningIcon'; |
|
|
|
|
|
|
|
|
|
|
|
export const TeamSidebar: FunctionalComponent<{ |
|
|
|
export const TeamSidebar: FunctionalComponent<{ |
|
|
|
activePageId: string; |
|
|
|
activePageId: string; |
|
|
|
}> = ({ activePageId, children }) => { |
|
|
|
}> = ({ activePageId, children }) => { |
|
|
|
const [menuShown, setMenuShown] = useState(false); |
|
|
|
const [menuShown, setMenuShown] = useState(false); |
|
|
|
const canManageCurrentTeam = useStore($canManageCurrentTeam); |
|
|
|
const currentTeam = useStore($currentTeam); |
|
|
|
|
|
|
|
|
|
|
|
const { teamId } = useTeamId(); |
|
|
|
const { teamId } = useTeamId(); |
|
|
|
|
|
|
|
|
|
|
@ -30,6 +31,7 @@ export const TeamSidebar: FunctionalComponent<{ |
|
|
|
href: `/team/roadmaps?t=${teamId}`, |
|
|
|
href: `/team/roadmaps?t=${teamId}`, |
|
|
|
id: 'roadmaps', |
|
|
|
id: 'roadmaps', |
|
|
|
icon: MapIcon, |
|
|
|
icon: MapIcon, |
|
|
|
|
|
|
|
hasWarning: currentTeam?.roadmaps?.length === 0, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: 'Members', |
|
|
|
title: 'Members', |
|
|
@ -120,7 +122,8 @@ export const TeamSidebar: FunctionalComponent<{ |
|
|
|
: 'border-r-transparent text-gray-500 hover:border-r-gray-300' |
|
|
|
: 'border-r-transparent text-gray-500 hover:border-r-gray-300' |
|
|
|
}`}
|
|
|
|
}`}
|
|
|
|
> |
|
|
|
> |
|
|
|
<span class="flex flex-grow items-center"> |
|
|
|
<span class="flex flex-grow items-center justify-between"> |
|
|
|
|
|
|
|
<span className="flex"> |
|
|
|
<img |
|
|
|
<img |
|
|
|
alt="menu icon" |
|
|
|
alt="menu icon" |
|
|
|
src={sidebarLink.icon} |
|
|
|
src={sidebarLink.icon} |
|
|
@ -128,6 +131,13 @@ export const TeamSidebar: FunctionalComponent<{ |
|
|
|
/> |
|
|
|
/> |
|
|
|
{sidebarLink.title} |
|
|
|
{sidebarLink.title} |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
|
|
|
|
{sidebarLink.hasWarning && ( |
|
|
|
|
|
|
|
<span class="relative mr-1 flex items-center"> |
|
|
|
|
|
|
|
<span class="relative rounded-full bg-red-200 p-1 text-xs" /> |
|
|
|
|
|
|
|
<span class="absolute bottom-0 left-0 right-0 top-0 animate-ping rounded-full bg-red-400 p-1 text-xs" /> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</span> |
|
|
|
</a> |
|
|
|
</a> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
); |
|
|
|
); |
|
|
|