diff --git a/src/pages/ErrorPage/NotFoundPage.tsx b/src/pages/ErrorPage/NotFoundPage.tsx index 7d5dd180709a..cfdeab9c51c7 100644 --- a/src/pages/ErrorPage/NotFoundPage.tsx +++ b/src/pages/ErrorPage/NotFoundPage.tsx @@ -5,17 +5,17 @@ import ScreenWrapper from '@components/ScreenWrapper'; type NotFoundPageProps = { onBackButtonPress?: () => void; -} & Pick; +} & FullPageNotFoundViewProps; // eslint-disable-next-line rulesdir/no-negated-variables -function NotFoundPage({onBackButtonPress, subtitleKey, onLinkPress}: NotFoundPageProps) { +function NotFoundPage({onBackButtonPress, ...fullPageNotFoundViewProps}: NotFoundPageProps) { return ( ); diff --git a/src/pages/workspace/AccessOrNotFoundWrapper.tsx b/src/pages/workspace/AccessOrNotFoundWrapper.tsx index c352717f5499..b6b641979319 100644 --- a/src/pages/workspace/AccessOrNotFoundWrapper.tsx +++ b/src/pages/workspace/AccessOrNotFoundWrapper.tsx @@ -43,29 +43,32 @@ type AccessOrNotFoundWrapperProps = AccessOrNotFoundWrapperOnyxProps & { /** The current feature name that the user tries to get access to */ featureName?: PolicyFeatureName; + + /** Props for customizing fallback pages */ + fullPageNotFoundViewProps?: FullPageNotFoundViewProps; } & Pick; -type PageNotFoundFallbackProps = Pick & {shouldShowFullScreenFallback: boolean}; +type PageNotFoundFallbackProps = Pick & {shouldShowFullScreenFallback: boolean}; -function PageNotFoundFallback({policyID, shouldShowFullScreenFallback, subtitleKey, onLinkPress}: PageNotFoundFallbackProps) { +function PageNotFoundFallback({policyID, shouldShowFullScreenFallback, fullPageNotFoundViewProps}: PageNotFoundFallbackProps) { return shouldShowFullScreenFallback ? ( Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)} shouldForceFullScreen - subtitleKey={subtitleKey} - onLinkPress={onLinkPress} + // eslint-disable-next-line react/jsx-props-no-spreading + {...fullPageNotFoundViewProps} /> ) : ( Navigation.goBack(ROUTES.WORKSPACE_PROFILE.getRoute(policyID))} - subtitleKey={subtitleKey} - onLinkPress={onLinkPress} + // eslint-disable-next-line react/jsx-props-no-spreading + {...fullPageNotFoundViewProps} /> ); } -function AccessOrNotFoundWrapper({accessVariants = [], subtitleKey, onLinkPress, ...props}: AccessOrNotFoundWrapperProps) { +function AccessOrNotFoundWrapper({accessVariants = [], fullPageNotFoundViewProps, ...props}: AccessOrNotFoundWrapperProps) { const {policy, policyID, featureName, isLoadingReportData} = props; const isPolicyIDInRoute = !!policyID?.length; @@ -100,8 +103,7 @@ function AccessOrNotFoundWrapper({accessVariants = [], subtitleKey, onLinkPress, ); } diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.tsx b/src/pages/workspace/WorkspaceInviteMessagePage.tsx index 801d7be264cd..2eaa38b865e6 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.tsx +++ b/src/pages/workspace/WorkspaceInviteMessagePage.tsx @@ -136,8 +136,7 @@ function WorkspaceInviteMessagePage({