Skip to content

Commit

Permalink
feat(frontend): Update profile dropdown disable logic in dashboard
Browse files Browse the repository at this point in the history
Modified the disable logic on the profile dropdown in the dashboard
section. Now it only considers the number of profiles available in
the profileSet for disabling the dropdown. Removed unnecessary
comments regarding profile name truncation and error handling.

Refs: #1
  • Loading branch information
maikbasel committed Jan 9, 2024
1 parent 1beefe6 commit 7fe3d27
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/sections/dashboard/components/header/profile-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import { ChevronDown, ChevronUp } from 'lucide-react';
import { useProfileContext } from '@/sections/dashboard/context/profile-context';
import { z } from 'zod';

// TODO:
// - Truncate profile names longer than 4 characters
// - Handle errors

interface ProfileNavItemProps {
profileName: string;
accessKeyId: string;
Expand Down Expand Up @@ -110,7 +106,7 @@ export function ProfileNav() {
aria-expanded={open}
aria-haspopup='true'
className='flex items-center justify-start gap-2 p-2'
// disabled={profileSet!.profiles.size < 2}
disabled={profileSet && Object.keys(profileSet.profiles).length < 2}
>
<Avatar className='h-9 w-9'>
<AvatarFallback>{currentProfile}</AvatarFallback>
Expand Down

0 comments on commit 7fe3d27

Please sign in to comment.