Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 51 additions & 3 deletions app/(tabs)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,57 @@
import { Text, View } from 'react-native';
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
import { useRouter } from "expo-router";
import { Pressable, ScrollView, Text, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";

export default function HomeScreen() {
const router = useRouter();
const tabBarHeight = useBottomTabBarHeight();
const insets = useSafeAreaInsets();

const H_PADDING = 24;
const CTA_GAP = 12;

return (
<View className="flex-1 items-center justify-center bg-milk-coffee">
<Text className="text-xl font-semibold text-dark-coffee">Home Screen</Text>
<View className="flex-1 bg-cream">
{/* Header Card */}
<View
className="bg-dark-coffee w-full pb-6 rounded-b-3xl shadow-sm"
style={{ paddingTop: insets.top + 16, paddingHorizontal: H_PADDING }}
>
<Text className="text-white text-3xl font-bold tracking-wider">
Kopi Shop
</Text>
</View>

{/* Content */}
<ScrollView
className="flex-1"
contentContainerStyle={{
paddingTop: 24,
paddingHorizontal: H_PADDING,
paddingBottom: tabBarHeight + 72 + CTA_GAP,
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paddingBottom calculation may not account for the bottom CTA button height correctly. The button appears to be absolutely positioned, but this calculation uses 72 as a magic number which seems intended to represent the button height plus spacing. However, the actual button height is defined by py-4 (padding vertical) plus text height, which may not equal 72 pixels. Consider extracting the button height as a constant (e.g., const CTA_HEIGHT = 60;) and using it consistently in both the ScrollView's paddingBottom and for layout calculations to ensure the content doesn't get hidden behind the button.

Copilot uses AI. Check for mistakes.
}}
showsVerticalScrollIndicator={false}
>
{/* Placeholder for future content */}
</ScrollView>

{/* Bottom CTA */}
<View
style={{
paddingHorizontal: H_PADDING,
paddingBottom: tabBarHeight + CTA_GAP,
}}
>
Comment on lines +40 to +45
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Bottom CTA is not absolutely positioned but should be to achieve the intended "floating above the tab bar" effect. Currently, the View with the Pressable is a sibling to the ScrollView in the flex container, which means it will always be visible at the bottom. To properly position it as an overlay (allowing scrolling content to go underneath), add className="absolute" or style={{ position: 'absolute' }} to the View on line 40, and also specify bottom: 0, left: 0, right: 0 in the style prop. This matches the pattern used in kopi.tsx (line 102) where the "Brew Button" is absolutely positioned.

Copilot uses AI. Check for mistakes.
<Pressable
onPress={() => router.push("/kopi")}
className="bg-dark-coffee py-4 px-5 rounded-2xl flex-row items-center justify-center shadow-lg active:opacity-90"
>
<Text className="text-white text-lg font-bold tracking-wide">
Start Kopi Maker →
</Text>
</Pressable>
</View>
</View>
);
}