feat: 适配 headerbar ios26
This commit is contained in:
@@ -5,6 +5,7 @@ import { Colors } from '@/constants/Colors';
|
||||
import { DEFAULT_IMAGE_FOOD } from '@/constants/Image';
|
||||
import { useAppDispatch } from '@/hooks/redux';
|
||||
import { useFoodLibrary, useFoodSearch } from '@/hooks/useFoodLibrary';
|
||||
import { useSafeAreaTop } from '@/hooks/useSafeAreaWithPadding';
|
||||
import { addDietRecord, type CreateDietRecordDto } from '@/services/dietRecords';
|
||||
import { foodLibraryApi, type CreateCustomFoodDto } from '@/services/foodLibraryApi';
|
||||
import { fetchDailyNutritionData } from '@/store/nutritionSlice';
|
||||
@@ -36,6 +37,7 @@ const MEAL_TYPE_MAP = {
|
||||
};
|
||||
|
||||
export default function FoodLibraryScreen() {
|
||||
const safeAreaTop = useSafeAreaTop()
|
||||
const router = useRouter();
|
||||
const params = useLocalSearchParams<{ mealType?: string }>();
|
||||
const mealType = (params.mealType as MealType) || 'breakfast';
|
||||
@@ -272,7 +274,6 @@ export default function FoodLibraryScreen() {
|
||||
<HeaderBar
|
||||
title="食物库"
|
||||
onBack={() => router.back()}
|
||||
transparent={false}
|
||||
variant="elevated"
|
||||
right={
|
||||
<TouchableOpacity style={styles.customButton} onPress={handleCreateCustomFood}>
|
||||
@@ -281,6 +282,10 @@ export default function FoodLibraryScreen() {
|
||||
}
|
||||
/>
|
||||
|
||||
<View style={{
|
||||
paddingTop: safeAreaTop
|
||||
}} />
|
||||
|
||||
{/* 搜索框 */}
|
||||
<View style={styles.searchContainer}>
|
||||
<Ionicons name="search" size={20} color="#999" style={styles.searchIcon} />
|
||||
|
||||
Reference in New Issue
Block a user