|
|
|
@ -9,7 +9,7 @@ import { $currentTeam, $teamList } from '../../stores/team'; |
|
|
|
|
import { useStore } from '@nanostores/preact'; |
|
|
|
|
import { useTeamId } from '../../hooks/use-team-id'; |
|
|
|
|
import { useToast } from '../../hooks/use-toast'; |
|
|
|
|
import type {ValidTeamType} from "../CreateTeam/Step0"; |
|
|
|
|
import type { ValidTeamType } from '../CreateTeam/Step0'; |
|
|
|
|
|
|
|
|
|
const allowedStatus = ['invited', 'joined', 'rejected'] as const; |
|
|
|
|
export type AllowedMemberStatus = (typeof allowedStatus)[number]; |
|
|
|
@ -81,12 +81,17 @@ export function TeamDropdown() { |
|
|
|
|
if ( |
|
|
|
|
!user?.email.endsWith('@insightpartners.com') && |
|
|
|
|
!user?.email.endsWith('@roadmap.sh') && |
|
|
|
|
!['arikchangma@gmail.com', 'kamranahmed.se@gmail.com', 'stephen.chetcuti@gmail.com'].includes(user?.email!) |
|
|
|
|
![ |
|
|
|
|
'arikchangma@gmail.com', |
|
|
|
|
'kamranahmed.se@gmail.com', |
|
|
|
|
'stephen.chetcuti@gmail.com', |
|
|
|
|
].includes(user?.email!) |
|
|
|
|
) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
<div className="relative mr-2"> |
|
|
|
|
<button |
|
|
|
|
className="flex w-full cursor-pointer items-center justify-between rounded border p-2 text-sm hover:bg-gray-100" |
|
|
|
@ -97,13 +102,14 @@ export function TeamDropdown() { |
|
|
|
|
{pendingTeamIds.length} |
|
|
|
|
</span> |
|
|
|
|
)} |
|
|
|
|
<div className="inline-grid grid-cols-[16px_auto] items-center gap-1.5 mr-1.5"> |
|
|
|
|
<div className="mr-1.5 inline-grid grid-cols-[16px_auto] items-center gap-1.5"> |
|
|
|
|
{isLoading && <Spinner className="h-4 w-4" isDualRing={false} />} |
|
|
|
|
{!isLoading && ( |
|
|
|
|
<img |
|
|
|
|
src={ |
|
|
|
|
selectedAvatar |
|
|
|
|
? `${import.meta.env.PUBLIC_AVATAR_BASE_URL |
|
|
|
|
? `${ |
|
|
|
|
import.meta.env.PUBLIC_AVATAR_BASE_URL |
|
|
|
|
}/${selectedAvatar}` |
|
|
|
|
: '/images/default-avatar.png' |
|
|
|
|
} |
|
|
|
@ -147,7 +153,9 @@ export function TeamDropdown() { |
|
|
|
|
className="flex w-full cursor-pointer items-center gap-2 rounded p-2 text-sm font-medium text-slate-100 hover:bg-slate-700" |
|
|
|
|
href={`${pageLink}`} |
|
|
|
|
> |
|
|
|
|
<span className="flex-grow min-w-0 truncate">{team.name}</span> |
|
|
|
|
<span className="min-w-0 flex-grow truncate"> |
|
|
|
|
{team.name} |
|
|
|
|
</span> |
|
|
|
|
{pendingTeamIds.includes(team._id) && ( |
|
|
|
|
<span className="flex rounded-md bg-red-500 px-2 text-xs text-white"> |
|
|
|
|
Invite |
|
|
|
@ -167,8 +175,8 @@ export function TeamDropdown() { |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|
<hr class='my-4' /> |
|
|
|
|
</div> |
|
|
|
|
<hr class="my-4" /> |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|