diff --git a/src/components/Page/Page.jsx b/src/components/Page/Page.jsx index 3d43ea7..bcb7e27 100644 --- a/src/components/Page/Page.jsx +++ b/src/components/Page/Page.jsx @@ -1,4 +1,4 @@ -import { createEffect } from 'solid-js'; +import { createEffect, createMemo } from 'solid-js'; import { backButton } from '@telegram-apps/sdk-solid'; import { useNavigate } from '@solidjs/router'; @@ -7,9 +7,10 @@ import './Page.css'; export function Page(props) { const navigate = useNavigate(); + const back = createMemo(() => typeof props.back === 'boolean' ? props.back : true); createEffect(() => { - if (props.back) { + if (back()) { backButton.show(); return backButton.onClick(() => { navigate(-1); diff --git a/src/pages/IndexPage/IndexPage.jsx b/src/pages/IndexPage/IndexPage.jsx index 88340da..085d20e 100644 --- a/src/pages/IndexPage/IndexPage.jsx +++ b/src/pages/IndexPage/IndexPage.jsx @@ -9,7 +9,7 @@ import './IndexPage.css'; export function IndexPage() { return ( - +

This page is a home page in this boilerplate. You can use the links below to visit other pages with their own functionality. diff --git a/src/pages/InitDataPage/InitDataPage.jsx b/src/pages/InitDataPage/InitDataPage.jsx index 2ea7fbe..a27f071 100644 --- a/src/pages/InitDataPage/InitDataPage.jsx +++ b/src/pages/InitDataPage/InitDataPage.jsx @@ -87,7 +87,6 @@ export function InitDataPage() { return ( diff --git a/src/pages/LaunchParamsPage.jsx b/src/pages/LaunchParamsPage.jsx index 789c376..e7804f8 100644 --- a/src/pages/LaunchParamsPage.jsx +++ b/src/pages/LaunchParamsPage.jsx @@ -9,7 +9,6 @@ export function LaunchParamsPage() { return ( diff --git a/src/pages/ThemeParamsPage.jsx b/src/pages/ThemeParamsPage.jsx index 574448b..a2dcb8c 100644 --- a/src/pages/ThemeParamsPage.jsx +++ b/src/pages/ThemeParamsPage.jsx @@ -9,7 +9,6 @@ export function ThemeParamsPage() { return ( diff --git a/src/pages/TonConnectPage/TonConnectPage.jsx b/src/pages/TonConnectPage/TonConnectPage.jsx index e5ecfc8..4500fc9 100644 --- a/src/pages/TonConnectPage/TonConnectPage.jsx +++ b/src/pages/TonConnectPage/TonConnectPage.jsx @@ -12,7 +12,7 @@ export function TonConnectPage() { const wallet = useTonWallet(); return ( - +