Skip to content

Commit

Permalink
remove deprecated prop profileMenu from TopNavigation (#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirineJ authored Jan 22, 2025
1 parent 2f545c4 commit 6ad9edb
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 369 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-ears-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sumup-oss/circuit-ui": minor
---

Removed the deprecated `profileMenu` and `user` props from the TopNavigation component.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { describe, expect, it, vi } from 'vitest';
import { Shop, SumUpLogo } from '@sumup-oss/icons';

import { axe, render, screen } from '../../util/test-utils.js';
import type { PopoverProps } from '../Popover/index.js';

import { TopNavigation, type TopNavigationProps } from './TopNavigation.js';

Expand All @@ -39,29 +38,6 @@ describe('TopNavigation', () => {
activeLabel: 'Close menu',
inactiveLabel: 'Open menu',
},
user: {
name: 'Jane Doe',
id: 'ID: AC3YULT8',
},
profileMenu: {
label: 'Open profile menu',
actions: [
{
onClick: vi.fn(),
children: 'View profile',
},
{
onClick: vi.fn(),
children: 'Settings',
},
{ type: 'divider' },
{
onClick: vi.fn(),
children: 'Logout',
destructive: true,
},
] as PopoverProps['actions'],
},
links: [
{
icon: Shop,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,32 +90,6 @@ export const baseArgs: TopNavigationProps = {
<SumUpLogo />
</a>
),
user: {
name: 'Jane Doe',
id: 'ID: AC3YULT8',
},
profileMenu: {
label: 'Open profile menu',
actions: [
{
href: '/profile',
onClick: action('View profile'),
children: 'View profile',
},
{
href: '/settings',
onClick: action('Settings'),
children: 'Settings',
},
{ type: 'divider' },
{
onClick: action('Logout'),
children: 'Logout',
destructive: true,
},
],
className: 'custom-class-name',
},
links: [
{
key: 'custom',
Expand Down
16 changes: 0 additions & 16 deletions packages/circuit-ui/components/TopNavigation/TopNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,10 @@ import { clsx } from '../../styles/clsx.js';
import { utilClasses } from '../../styles/utility.js';
import { SkipLink } from '../SkipLink/index.js';

import {
ProfileMenu,
type ProfileMenuProps,
} from './components/ProfileMenu/index.js';
import {
UtilityLinks,
type UtilityLinksProps,
} from './components/UtilityLinks/index.js';
import type { UserProps } from './types.js';
import classes from './TopNavigation.module.css';

/**
Expand All @@ -44,14 +39,6 @@ export interface TopNavigationProps
HTMLAttributes<HTMLElement> {
logo: ReactNode;
hamburger?: HamburgerProps;
/**
* @deprecated Use a custom component in the `links` prop instead.
*/
profileMenu?: Omit<ProfileMenuProps, 'user'>;
/**
* @deprecated Use a custom component in the `links` prop instead.
*/
user?: UserProps;
isLoading?: boolean;
/**
* Hash link to the page's main content to enable keyboard and screen reader
Expand All @@ -67,8 +54,6 @@ export interface TopNavigationProps

export function TopNavigation({
logo,
user,
profileMenu,
links,
hamburger,
isLoading,
Expand Down Expand Up @@ -108,7 +93,6 @@ export function TopNavigation({
isLoading={Boolean(isLoading)}
>
{links && <UtilityLinks links={links} />}
{profileMenu && user && <ProfileMenu {...profileMenu} user={user} />}
</SkeletonContainer>
</header>
);
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6ad9edb

Please sign in to comment.