feat: unauthenticated tab
This commit is contained in:
@@ -19,6 +19,13 @@ const TabBar = ({ state = {}, descriptors = {}, navigation = {} }) => {
|
||||
: isIOS
|
||||
? Math.max(bottomInset, fallbackBottomOffset)
|
||||
: bottomInset + fallbackBottomOffset;
|
||||
const visibleRoutesCount = Math.max(
|
||||
1,
|
||||
(state?.routes || []).reduce((count, route) => {
|
||||
const descriptor = descriptors[route.key];
|
||||
return descriptor?.options?.hide ? count : count + 1;
|
||||
}, 0)
|
||||
);
|
||||
|
||||
return (
|
||||
<View
|
||||
@@ -87,7 +94,7 @@ const TabBar = ({ state = {}, descriptors = {}, navigation = {} }) => {
|
||||
key={route.key}
|
||||
style={{
|
||||
alignSelf: "center",
|
||||
width: `${100 / state?.routes?.length}%`,
|
||||
width: `${100 / visibleRoutesCount}%`,
|
||||
height: "100%",
|
||||
...Style.containerCenter,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user