Skip to content

Commit

Permalink
Remove reduntant component
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Feb 9, 2023
1 parent 9644256 commit 5d0446d
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions packages/components/src/navigator/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,25 +105,6 @@ function CustomNavigatorButton( {
);
}

function CustomNavigatorButtonWithFocusRestoration( {
path,
onClick,
...props
}: Omit< ComponentPropsWithoutRef< typeof NavigatorButton >, 'onClick' > & {
onClick?: CustomTestOnClickHandler;
} ) {
return (
<NavigatorButton
onClick={ () => {
// Used to spy on the values passed to `navigator.goTo`.
onClick?.( { type: 'goTo', path } );
} }
path={ path }
{ ...props }
/>
);
}

function CustomNavigatorBackButton( {
onClick,
...props
Expand Down Expand Up @@ -219,12 +200,12 @@ const MyNavigation = ( {
* navigating to screen as a result of a backwards navigation.
*/ }
<button>First tabbable child screen button</button>
<CustomNavigatorButtonWithFocusRestoration
<CustomNavigatorButton
path={ PATHS.NESTED }
onClick={ onNavigatorButtonClick }
>
{ BUTTON_TEXT.toNestedScreen }
</CustomNavigatorButtonWithFocusRestoration>
</CustomNavigatorButton>
<CustomNavigatorBackButton
onClick={ onNavigatorButtonClick }
>
Expand Down

0 comments on commit 5d0446d

Please sign in to comment.