Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use proper hook on NotFoundPage & fix typecheck #48841

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/pages/ErrorPage/NotFoundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import type {FullPageNotFoundViewProps} from '@components/BlockingViews/FullPageNotFoundView';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import ScreenWrapper from '@components/ScreenWrapper';
import useWindowDimensions from '@hooks/useWindowDimensions';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import Navigation from '@libs/Navigation/Navigation';
import * as ReportUtils from '@libs/ReportUtils';

Expand All @@ -13,14 +13,14 @@ type NotFoundPageProps = {

// eslint-disable-next-line rulesdir/no-negated-variables
function NotFoundPage({onBackButtonPress = () => Navigation.goBack(), isReportRelatedPage, ...fullPageNotFoundViewProps}: NotFoundPageProps) {
const {isSmallScreen} = useWindowDimensions();
const {isSmallScreenWidth} = useResponsiveLayout();

return (
<ScreenWrapper testID={NotFoundPage.displayName}>
<FullPageNotFoundView
shouldShow
onBackButtonPress={() => {
if (!isReportRelatedPage || !isSmallScreen) {
if (!isReportRelatedPage || !isSmallScreenWidth) {
onBackButtonPress();
return;
}
Expand Down
Loading