Preserve navigation state when adding custom fields (#6399)

@lucasbordeau
Issue #6374 
Fixed the navigation state issue! I also found and resolved a similar
bug with the "Edit Fields" functionality. The
`setNavigationMemorizedUrl` state now correctly updates on navigation to
settings, ensuring users return to the correct page.

Please review.
This commit is contained in:
nitin
2024-08-05 20:20:08 +05:30
committed by GitHub
parent 2073d8e6e1
commit eba79d2ea5
3 changed files with 36 additions and 12 deletions

View File

@ -1,24 +1,31 @@
import styled from '@emotion/styled';
import React from 'react';
import { Link } from 'react-router-dom';
import styled from '@emotion/styled';
const StyledUndecoratedLink = styled(Link)`
text-decoration: none;
width: 100%;
`;
type UndecoratedLinkProps = {
to: string | number;
children: React.ReactNode;
replace?: boolean;
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
};
export const UndecoratedLink = ({
children,
to,
replace = false,
onClick,
}: UndecoratedLinkProps) => {
return (
<StyledUndecoratedLink to={to as string} replace={replace}>
<StyledUndecoratedLink
to={to as string}
replace={replace}
onClick={onClick}
>
{children}
</StyledUndecoratedLink>
);