B2B-31: clean code

This commit is contained in:
devmc-ee
2025-06-30 19:25:03 +03:00
parent fbbc2f8760
commit c72668dc23
4 changed files with 9 additions and 10 deletions

View File

@@ -10,7 +10,6 @@ import { ShoppingCart } from 'lucide-react';
export function HomeMenuNavigation(props: { workspace: UserWorkspace }) { export function HomeMenuNavigation(props: { workspace: UserWorkspace }) {
const { workspace, user, accounts } = props.workspace; const { workspace, user, accounts } = props.workspace;
console.log('HomeMenuNavigation', accounts)
return ( return (
<div className={'flex w-full flex-1 justify-between'}> <div className={'flex w-full flex-1 justify-between'}>
<div className={'flex items-center space-x-8'}> <div className={'flex items-center space-x-8'}>

View File

@@ -58,7 +58,7 @@ export function TeamAccountNavigationMenu(props: {
<ProfileAccountDropdownContainer <ProfileAccountDropdownContainer
user={user} user={user}
account={account} account={account}
showProfileName={true} showProfileName
accounts={accounts} accounts={accounts}
/> />
</div> </div>

View File

@@ -39,7 +39,7 @@ export function ProfileAccountDropdownContainer(props: {
if (!userData) { if (!userData) {
return null; return null;
} }
console.log(props.accounts)
return ( return (
<PersonalAccountDropdown <PersonalAccountDropdown
className={'w-full'} className={'w-full'}

View File

@@ -40,7 +40,7 @@ export function PersonalAccountDropdown({
paths, paths,
features, features,
account, account,
accounts accounts = []
}: { }: {
user: User; user: User;
@@ -103,7 +103,7 @@ export function PersonalAccountDropdown({
className ?? '', className ?? '',
{ {
['active:bg-secondary/50 items-center gap-4 rounded-md' + ['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 /> <DropdownMenuSeparator />
<If condition={(accounts ?? []).length > 0}> <If condition={accounts.length > 0}>
<span className='px-2 text-muted-foreground text-xs'> <span className='px-2 text-muted-foreground text-xs'>
<Trans <Trans
i18nKey={'teams:yourTeams'} i18nKey={'teams:yourTeams'}
values={{ teamsCount: (accounts ?? []).length }} values={{ teamsCount: accounts.length }}
/> />
</span> </span>
{(accounts ?? []).map((account) => ( {accounts.map((account) => (
<DropdownMenuItem key={account.value} asChild> <DropdownMenuItem key={account.value} asChild>
<Link <Link
className={'s-full flex cursor-pointer items-center space-x-2'} className={'s-full flex cursor-pointer items-center space-x-2'}
href={`/home/${account.value}`} href={`/home/${account.value}`}
> >
<div className={'flex items-center'}> <div className={'flex items-center'}>
<Avatar className={'rounded-xs h-5 w-5'}> <Avatar className={'rounded-xs h-5 w-5 ' + account.image}>
<AvatarImage src={account.image ?? undefined} /> <AvatarImage {...(account.image && { src: account.image })} />
<AvatarFallback <AvatarFallback
className={cn('rounded-md', { className={cn('rounded-md', {