From 7fe1b89f5b8760d83695b7a411041b08cceb2263 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 7 Oct 2025 19:31:40 +0300 Subject: [PATCH] Update PageHeader component to conditionally hide BackButton based on environment and TMA status - Modified the logic in the PageHeader component to hide the BackButton when in production or when the TMA status is 'simple', improving user experience by reducing unnecessary navigation options. --- apps/web/components/navigation/header/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/web/components/navigation/header/index.tsx b/apps/web/components/navigation/header/index.tsx index d7b6731..362154b 100644 --- a/apps/web/components/navigation/header/index.tsx +++ b/apps/web/components/navigation/header/index.tsx @@ -1,4 +1,5 @@ 'use client'; + import { BackButton } from './back-button'; import { cn } from '@repo/ui/lib/utils'; import { isTMA } from '@telegram-apps/sdk-react'; @@ -6,16 +7,16 @@ import { isTMA } from '@telegram-apps/sdk-react'; type Props = { title: string | undefined }; export function PageHeader(props: Readonly) { - const isTG = isTMA('simple'); + const hideBackButton = process.env.NODE_ENV === 'production' || isTMA('simple'); return (
- {!isTG && } + {!hideBackButton && } {props.title}
);