Skip to content

Commit

Permalink
fix: made reset-on-exit optional
Browse files Browse the repository at this point in the history
  • Loading branch information
malmen237 committed Apr 23, 2024
1 parent 32fe404 commit 910424c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/manage-productions/manage-productions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const ManageProductions = () => {
return (
<Container>
<StyledBackBtnIcon>
<NavigateToRootButton resetOnExit={() => null} />
<NavigateToRootButton />
</StyledBackBtnIcon>
<DisplayContainerHeader>Remove Production</DisplayContainerHeader>
<FormLabel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ const StyledBackBtn = styled(ActionButton)`
export const NavigateToRootButton = ({
resetOnExit,
}: {
resetOnExit: () => void | null;
resetOnExit?: () => void;
}) => {
const navigate = useNavigate();

return (
<StyledBackBtn
type="button"
onClick={() => {
if (resetOnExit) {
resetOnExit();
}
navigate("/");
resetOnExit();
}}
>
<BackArrow />
Expand Down

0 comments on commit 910424c

Please sign in to comment.