Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f
- Upgraded the `Banner`, `Card`, and `Modal` components from legacy context API to use createContext ([#786](https://github.com/Shopify/polaris-react/pull/786))

### Deprecations

- Deprecated `Navigation.UserMenu` in favor of `TopBar.UserMenu` ([#849](https://github.com/Shopify/polaris-react/pull/849))
4 changes: 4 additions & 0 deletions src/components/Navigation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ The user menu component displays the current user’s avatar and name, and actio
| avatarInitials | AvatarProps['initials'] | The merchant’s initials, rendered in place of an avatar image when not provided |
| avatarSource | AvatarProps['source'] | An avatar image representing the merchant |

### Deprecation rationale

As of release 3.4.1 `Navigation.UserMenu` will be deprecated in favor of [`TopBar.UserMenu`](https://polaris.shopify.com/components/structure/top-bar#top-bar-menu). `TopBar.UserMenu` will stay visible on mobile with the updated `TopBar` layout.

---

## Examples
Expand Down
9 changes: 9 additions & 0 deletions src/components/Navigation/components/UserMenu/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,20 @@ interface State {
userMenuExpanded?: boolean;
}

/** @deprecated Use <TopBar.UserMenu /> instead. */
export default class UserMenu extends React.PureComponent<Props, State> {
state: State = {
userMenuExpanded: false,
};

constructor(props: Props) {
super(props);
// eslint-disable-next-line no-console
console.warn(
'Deprecation: <Navigation.UserMenu /> is deprecated and will be removed in the next major version. Use <TopBar.UserMenu /> instead.',
);
}

render() {
const {
name,
Expand Down