diff --git a/minibits.inlang/.gitignore b/minibits.inlang/.gitignore index 5e46596..04df330 100644 --- a/minibits.inlang/.gitignore +++ b/minibits.inlang/.gitignore @@ -1 +1,19 @@ -cache \ No newline at end of file +# IF GIT SHOWED THAT THIS FILE CHANGED +# +# 1. RUN THE FOLLOWING COMMAND +# +# --- +# git rm --cached '**/*.inlang/.gitignore' +# --- +# +# 2. COMMIT THE CHANGE +# +# --- +# git commit -m "fix: remove tracked .gitignore from inlang project" +# --- +# +# Inlang handles the gitignore itself starting with version ^2.5. +# +# everything is ignored except settings.json +* +!settings.json \ No newline at end of file diff --git a/src/screens/WalletScreen.tsx b/src/screens/WalletScreen.tsx index dc569b6..f6aff39 100644 --- a/src/screens/WalletScreen.tsx +++ b/src/screens/WalletScreen.tsx @@ -108,6 +108,10 @@ export const WalletScreen = observer(function WalletScreen({ route }: Props) { const [updateSize, setUpdateSize] = useState('') const [isNativeUpdateAvailable, setIsNativeUpdateAvailable] = useState(false) const [isOnline, setIsOnline] = useState(false) + // Measured heights used to size the TabView so it hugs the active tab's + // content (header balance block + transactions card) without clipping it. + const [tabSceneHeight, setTabSceneHeight] = useState(0) + const [tabBarHeight, setTabBarHeight] = useState(0) useEffect(() => { if (isInternetReachable !== null) { @@ -594,7 +598,17 @@ export const WalletScreen = observer(function WalletScreen({ route }: Props) { const recentTransactions = transactionsStore.getRecentByUnit(unitMints.unit) return ( - <> + { + // Report the active tab's natural content height (the + // height stays correct even while visually clipped) so + // the TabView can be sized to fit it exactly. + if (route.key === routes[tabIndex]?.key) { + const h = e.nativeEvent.layout.height + setTabSceneHeight(prev => (Math.abs(prev - h) > 1 ? h : prev)) + } + }} + > )} - - + + ) } } @@ -665,10 +679,14 @@ export const WalletScreen = observer(function WalletScreen({ route }: Props) { const tabWidth = moderateScale(82) const renderTabBar = useCallback((props: any) => { - // A single unit tab needs no switcher. - if (routes.length <= 1) return null return( - + { + const h = e.nativeEvent.layout.height + setTabBarHeight(prev => (Math.abs(prev - h) > 1 ? h : prev)) + }} + > c.remainingDailyLimit !== c.dailyLimit) const nwcCardsData = nwcStore.all.filter(c => c.remainingDailyLimit !== c.dailyLimit) + // Size the TabView to the measured tab bar + active scene content so it hugs + // the transactions card (the tab bar's negative top margin overlaps the + // header by spacing.small). Falls back to a generous height until measured, + // which never clips. All space beyond this goes to the centered NWC band. + const tabViewHeight = tabSceneHeight > 0 && tabBarHeight > 0 + ? tabSceneHeight + tabBarHeight - spacing.small + : spacing.screenHeight * 0.5 + return (
} /> - {groupedMints.length > 0 && ( - - )} - {isNwcVisible && ( - - { - return ( - } - ContentComponent={ - <> - - - - } - style={{ - width: spacing.screenWidth * 0.28, - marginRight: spacing.small, - marginBottom: spacing.extraSmall - }} - /> - )} - } - style={{ - - - }} + {groupedMints.length > 0 && ( + + + - )} + + )} + {/* Flexible band between the transactions card and the bottom buttons. + It absorbs all leftover vertical space and keeps the NWC card(s) + vertically centered, so the gap above (to the card) and below + (to the Scan button) stays even. The TabView no longer grows into + this space, so the transactions card is never clipped. */} + + {/* Stub to preview the NWC card UI in the simulator (NWC unavailable there). */} + {__DEV__ && ( + + } + ContentComponent={ + <> + + + + } + style={$nwcCard} + /> + + )} + {isNwcVisible && ( + + { + return ( + } + ContentComponent={ + <> + + + + } + style={$nwcCard} + /> + )} + } + /> + + )} +