This commit is contained in:
2025-09-30 14:53:14 +02:00
parent 6bb6576281
commit ccce5ce264
2 changed files with 5 additions and 20 deletions
+2 -2
View File
@@ -29,8 +29,8 @@ export const BottomTabScreen = () => {
{ {
width: Platform.OS === "web" ? 30 : 24, width: Platform.OS === "web" ? 30 : 24,
height: Platform.OS === "web" ? 30 : 24, height: Platform.OS === "web" ? 30 : 24,
marginBottom: Platform.OS === "web" ? 13 : 0, // marginBottom: Platform.OS === "web" ? 13 : 0,
marginTop: Platform.OS === "web" ? 13 : 0, // marginTop: Platform.OS === "web" ? 13 : 0,
}, },
]} ]}
source={icon} source={icon}
+3 -18
View File
@@ -1,36 +1,21 @@
import * as Haptics from "expo-haptics"; import * as Haptics from "expo-haptics";
import React, { useMemo } from "react"; import React from "react";
import { Text, TouchableOpacity, View } from "react-native"; import { Text, TouchableOpacity, View } from "react-native";
import { useGlobal } from "reactn";
import ItemContainer from "../components/ItemContainer/ItemContainer"; import ItemContainer from "../components/ItemContainer/ItemContainer";
import useLayoutType from "../hooks/useLayoutType"; import useLayoutType from "../hooks/useLayoutType";
import { gutters, Palette, Style } from "../styles"; import { gutters, Palette, Style } from "../styles";
import { FONT_FAMILY } from "../styles/Fonts"; import { FONT_FAMILY } from "../styles/Fonts";
const TabBar = ({ state = {}, descriptors = {}, navigation = {} }) => { const TabBar = ({ state = {}, descriptors = {}, navigation = {} }) => {
const { windowWidth, isWeb } = useLayoutType(); const { isWeb } = useLayoutType();
const [webLayoutMode] = useGlobal("webLayoutMode");
const containerWidth = useMemo(() => {
if (!isWeb) return "90%";
const containerFraction = webLayoutMode === "playbacks-wide" ? 0.9 : 0.6;
const containerMax = webLayoutMode === "playbacks-wide" ? 1440 : 800;
const computedContainerWidth = Math.min(
windowWidth * containerFraction,
containerMax
);
const barWidth = Math.max(computedContainerWidth * 0.9, 360);
return barWidth;
}, [isWeb, webLayoutMode, windowWidth]);
return ( return (
<View <View
style={{ style={{
position: "absolute", position: "absolute",
bottom: gutters * 2, bottom: gutters * 2,
width: containerWidth, width: "90%",
maxWidth: 700, maxWidth: 700,
alignSelf: "center", alignSelf: "center",
zIndex: 1, zIndex: 1,