fix: tg safe area
All checks were successful
Deploy to VPS (dist) / deploy (push) Successful in 2m10s

This commit is contained in:
Hewston Fox
2026-03-18 23:06:36 +02:00
parent 43e52e7585
commit a1f6c57901
4 changed files with 51 additions and 27 deletions

View File

@@ -1,9 +1,10 @@
:root {
--header-height: 90px;
--header-total: calc(
var(--header-height) + var(--tg-safe-area-inset-top, 0px) +
var(--tg-content-safe-area-inset-top, 0px)
--header-padding: calc(
var(--tg-viewport-safe-area-inset-top, 0px) +
var(--tg-viewport-content-safe-area-inset-top, 0px)
);
--header-total: calc(var(--header-height) + var(--header-padding));
}
@layer base {
@@ -14,9 +15,7 @@
left: 0;
z-index: 10;
height: var(--header-total);
padding-top: calc(
var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)
);
padding-top: var(--header-padding);
background: rgb(59 130 246 / 0.3);
}
}

View File

@@ -1,6 +1,7 @@
:root {
--navigation-height: 74px;
--navigation-total: calc(var(--navigation-height) + var(--tg-safe-area-inset-bottom, 0px));
--navigation-padding: var(--tg-viewport-safe-area-inset-bottom, 0px);
--navigation-total: calc(var(--navigation-height) + var(--navigation-padding));
}
@layer base {
@@ -33,7 +34,7 @@
flex-direction: column;
align-items: center;
justify-content: flex-start;
padding-bottom: var(--tg-safe-area-inset-bottom, 0px);
padding-bottom: var(--navigation-padding);
}
.barActive {

View File

@@ -7,6 +7,7 @@ import { useEffect } from "react";
import { Route as GameRoute } from "./game";
import Header from "./-/Header";
import Navigation from "./-/Navigation";
import tg from "@/tg";
function AppLayout() {
return (
@@ -22,6 +23,17 @@ function AppLayout() {
);
}
tg.storage.setItem("authToken", "123");
tg.storage
.getItem("authToken")
.then((value) => {
console.log("Success", `$${value}$`);
})
.catch((error) => {
console.error("Error", error);
});
export const Route = createRootRoute({
notFoundComponent: () => {
const navigate = useNavigate();