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:
@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user