Merge pull request 'fix(tabs): prevent bottom navigation labels from being cut off' (#26) from fix/bottom-tab-bar-layout into main
Reviewed-on: https://10.10.0.4/AcuPedia/acupedia-mobile-ui/pulls/26 Reviewed-by: Amit Salunke <amit@noreply.localhost>
This commit is contained in:
commit
d319378ec8
|
|
@ -7,8 +7,9 @@ import { useAuthStore } from "@/store/auth.store";
|
||||||
|
|
||||||
export default function TabsLayout() {
|
export default function TabsLayout() {
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const bottomPadding = insets.bottom > 0 ? insets.bottom : 8;
|
const isWeb = Platform.OS === "web";
|
||||||
const tabBarHeight = 52 + bottomPadding;
|
const bottomPadding = insets.bottom > 0 ? insets.bottom : (isWeb ? 8 : 8);
|
||||||
|
const tabBarHeight = (isWeb ? 66 : 60) + (insets.bottom > 0 ? insets.bottom : 0);
|
||||||
|
|
||||||
const { accessToken, logout } = useAuthStore();
|
const { accessToken, logout } = useAuthStore();
|
||||||
const isAuthenticated = !!accessToken;
|
const isAuthenticated = !!accessToken;
|
||||||
|
|
@ -56,8 +57,17 @@ export default function TabsLayout() {
|
||||||
borderTopWidth: 1,
|
borderTopWidth: 1,
|
||||||
borderTopColor: "#E5E7EB",
|
borderTopColor: "#E5E7EB",
|
||||||
height: tabBarHeight,
|
height: tabBarHeight,
|
||||||
paddingBottom: bottomPadding,
|
paddingBottom: isWeb ? 8 : bottomPadding,
|
||||||
paddingTop: 8,
|
paddingTop: 6,
|
||||||
|
},
|
||||||
|
tabBarLabelStyle: {
|
||||||
|
fontSize: 11,
|
||||||
|
fontWeight: "500",
|
||||||
|
marginTop: 2,
|
||||||
|
},
|
||||||
|
tabBarItemStyle: {
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue