feat(lager): dedup per forvaringsplats + tydlig Ta bort per rad
Skann-bekraftelse slar bara ihop dubbletter inom SAMMA plats (mjolk i kyl != mjolk i frys) + hoppar over tomma poster. Lagerlistan far en tydlig 'Ta bort' direkt pa varje rad (inte bara via markering).
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useMemo, useState } from "react";
|
||||
import { Alert, View } from "react-native";
|
||||
import { Alert, Pressable, View } from "react-native";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { api } from "@/lib/api";
|
||||
@@ -193,12 +193,22 @@ export default function KitchenScreen() {
|
||||
onPress={() => toggle(item.id)}
|
||||
style={isSel ? { borderColor: colors.primary, backgroundColor: colors.primarySoft } : undefined}
|
||||
>
|
||||
<Row style={{ justifyContent: "space-between" }}>
|
||||
<Row style={{ justifyContent: "space-between", alignItems: "center" }}>
|
||||
<Body>
|
||||
{isSel ? "☑ " : "☐ "}
|
||||
{item.displayName} · {formatQuantity(item.quantity, item.unit)}
|
||||
</Body>
|
||||
{item.expiry.pastBestBefore && <Small>⚠︎ bäst före</Small>}
|
||||
<Row style={{ alignItems: "center", gap: 12 }}>
|
||||
{item.expiry.pastBestBefore && <Small>⚠︎ bäst före</Small>}
|
||||
<Pressable
|
||||
onPress={() => confirmDelete([item.id], locLabel(item.locationType))}
|
||||
hitSlop={8}
|
||||
>
|
||||
<Small style={{ color: colors.danger, fontWeight: "600" }}>
|
||||
{t("common.remove")}
|
||||
</Small>
|
||||
</Pressable>
|
||||
</Row>
|
||||
</Row>
|
||||
</Card>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user