B2B-31: clean code
This commit is contained in:
@@ -10,7 +10,6 @@ import { ShoppingCart } from 'lucide-react';
|
||||
|
||||
export function HomeMenuNavigation(props: { workspace: UserWorkspace }) {
|
||||
const { workspace, user, accounts } = props.workspace;
|
||||
console.log('HomeMenuNavigation', accounts)
|
||||
return (
|
||||
<div className={'flex w-full flex-1 justify-between'}>
|
||||
<div className={'flex items-center space-x-8'}>
|
||||
|
||||
@@ -58,7 +58,7 @@ export function TeamAccountNavigationMenu(props: {
|
||||
<ProfileAccountDropdownContainer
|
||||
user={user}
|
||||
account={account}
|
||||
showProfileName={true}
|
||||
showProfileName
|
||||
accounts={accounts}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -39,7 +39,7 @@ export function ProfileAccountDropdownContainer(props: {
|
||||
if (!userData) {
|
||||
return null;
|
||||
}
|
||||
console.log(props.accounts)
|
||||
|
||||
return (
|
||||
<PersonalAccountDropdown
|
||||
className={'w-full'}
|
||||
|
||||
@@ -40,7 +40,7 @@ export function PersonalAccountDropdown({
|
||||
paths,
|
||||
features,
|
||||
account,
|
||||
accounts
|
||||
accounts = []
|
||||
}: {
|
||||
user: User;
|
||||
|
||||
@@ -103,7 +103,7 @@ export function PersonalAccountDropdown({
|
||||
className ?? '',
|
||||
{
|
||||
['active:bg-secondary/50 items-center gap-4 rounded-md' +
|
||||
' hover:bg-secondary p-0 m-0 transition-colors border-1 rounded-md px-4 py-1 h-10']: showProfileName,
|
||||
' hover:bg-secondary m-0 transition-colors border-1 rounded-md px-4 py-1 h-10']: showProfileName,
|
||||
},
|
||||
)}
|
||||
>
|
||||
@@ -169,23 +169,23 @@ export function PersonalAccountDropdown({
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<If condition={(accounts ?? []).length > 0}>
|
||||
<If condition={accounts.length > 0}>
|
||||
<span className='px-2 text-muted-foreground text-xs'>
|
||||
<Trans
|
||||
i18nKey={'teams:yourTeams'}
|
||||
values={{ teamsCount: (accounts ?? []).length }}
|
||||
values={{ teamsCount: accounts.length }}
|
||||
/>
|
||||
</span>
|
||||
|
||||
{(accounts ?? []).map((account) => (
|
||||
{accounts.map((account) => (
|
||||
<DropdownMenuItem key={account.value} asChild>
|
||||
<Link
|
||||
className={'s-full flex cursor-pointer items-center space-x-2'}
|
||||
href={`/home/${account.value}`}
|
||||
>
|
||||
<div className={'flex items-center'}>
|
||||
<Avatar className={'rounded-xs h-5 w-5'}>
|
||||
<AvatarImage src={account.image ?? undefined} />
|
||||
<Avatar className={'rounded-xs h-5 w-5 ' + account.image}>
|
||||
<AvatarImage {...(account.image && { src: account.image })} />
|
||||
|
||||
<AvatarFallback
|
||||
className={cn('rounded-md', {
|
||||
|
||||
Reference in New Issue
Block a user