Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't show AccountListMenu back button by default #26940

Merged
merged 4 commits into from
Sep 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface ModalHeaderProps extends HeaderBaseStyleUtilityProps {
* The onClick handler for the back `ButtonIcon`
* When passed this will allow for the back `ButtonIcon` to show
*/
onBack?: () => void;
onBack?: () => void | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking: Should both onBack and onClose props use the same type?

/**
* The props to pass to the back `ButtonIcon`
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ describe('AccountListMenu', () => {

expect(getByPlaceholderText('Search accounts')).toBeInTheDocument();
expect(getByText('Add account or hardware wallet')).toBeInTheDocument();
expect(document.querySelector('[aria-label="Back"]')).toStrictEqual(null);
});

it('displays accounts for list and filters by search', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export const AccountListMenu = ({
);

// eslint-disable-next-line no-empty-function
let onBack = () => {};
let onBack;
if (actionMode !== ACTION_MODES.LIST) {
if (actionMode === ACTION_MODES.MENU) {
onBack = () => setActionMode(ACTION_MODES.LIST);
Expand Down