From 9ca2d0a24da48966a1e21cadde2f5db388a790c5 Mon Sep 17 00:00:00 2001 From: hm-sbartl Date: Fri, 10 Jul 2026 19:39:29 +0200 Subject: [PATCH 1/2] :bug: show score in the right color --- .../components/alternatives/ProductCard.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ecoscan_app/components/alternatives/ProductCard.tsx b/ecoscan_app/components/alternatives/ProductCard.tsx index 5b9430ad..0fbd79f1 100644 --- a/ecoscan_app/components/alternatives/ProductCard.tsx +++ b/ecoscan_app/components/alternatives/ProductCard.tsx @@ -1,5 +1,6 @@ -import { View, StyleSheet } from "react-native"; -import { Card, Text, Icon, useTheme } from "react-native-paper"; +import {StyleSheet, View} from "react-native"; +import {Card, Icon, Text} from "react-native-paper"; +import {getScoreColor} from "@/utils/scoreColor"; type ProductCardProps = { title: string; @@ -14,7 +15,8 @@ export default function ProductCard({ image, score, }: ProductCardProps) { - const theme = useTheme(); + const scoreColor = getScoreColor(score); + return ( @@ -22,8 +24,8 @@ export default function ProductCard({ Dein gescanntes Produkt - - + + {score} @@ -49,7 +51,7 @@ export default function ProductCard({ const styles = StyleSheet.create({ card: { - backgroundColor: "#e3e3e3", + backgroundColor: "#ececec", borderRadius: 16, padding: 12, marginVertical: 16, From fd9d5e861ea359400e884ca0e65e6d12ddaf6ccc Mon Sep 17 00:00:00 2001 From: hm-sbartl Date: Fri, 10 Jul 2026 19:40:16 +0200 Subject: [PATCH 2/2] :art: linting --- ecoscan_app/components/alternatives/ProductCard.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ecoscan_app/components/alternatives/ProductCard.tsx b/ecoscan_app/components/alternatives/ProductCard.tsx index 0fbd79f1..e2393830 100644 --- a/ecoscan_app/components/alternatives/ProductCard.tsx +++ b/ecoscan_app/components/alternatives/ProductCard.tsx @@ -1,6 +1,6 @@ -import {StyleSheet, View} from "react-native"; -import {Card, Icon, Text} from "react-native-paper"; -import {getScoreColor} from "@/utils/scoreColor"; +import { StyleSheet, View } from "react-native"; +import { Card, Icon, Text } from "react-native-paper"; +import { getScoreColor } from "@/utils/scoreColor"; type ProductCardProps = { title: string;