Create ESLint rule to discourage usage of navigate() and prefer Link (#5642)
### Description Create ESLint rule to discourage usage of navigate() and prefer Link ### Refs #5468 ### Demo   Fixes #5468 --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { SignInBackgroundMockPage } from '@/sign-in-background-mock/components/SignInBackgroundMockPage';
|
||||
@ -11,6 +10,7 @@ import {
|
||||
AnimatedPlaceholderErrorSubTitle,
|
||||
AnimatedPlaceholderErrorTitle,
|
||||
} from '@/ui/layout/animated-placeholder/components/ErrorPlaceholderStyled';
|
||||
import { UndecoratedLink } from '@/ui/navigation/link/components/UndecoratedLink';
|
||||
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
||||
|
||||
const StyledBackDrop = styled.div`
|
||||
@ -33,8 +33,6 @@ const StyledButtonContainer = styled.div`
|
||||
`;
|
||||
|
||||
export const NotFound = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageTitle title="Page Not Found | Twenty" />
|
||||
@ -51,11 +49,9 @@ export const NotFound = () => {
|
||||
</AnimatedPlaceholderErrorSubTitle>
|
||||
</AnimatedPlaceholderEmptyTextContainer>
|
||||
<StyledButtonContainer>
|
||||
<MainButton
|
||||
title="Back to content"
|
||||
fullWidth
|
||||
onClick={() => navigate(AppPath.Index)}
|
||||
/>
|
||||
<UndecoratedLink to={AppPath.Index}>
|
||||
<MainButton title="Back to content" fullWidth />
|
||||
</UndecoratedLink>
|
||||
</StyledButtonContainer>
|
||||
</AnimatedPlaceholderErrorContainer>
|
||||
</StyledBackDrop>
|
||||
|
||||
Reference in New Issue
Block a user