chore: fix bug ui
This commit is contained in:
@@ -10,6 +10,15 @@ import {
|
||||
Pressable,
|
||||
ScrollView,
|
||||
} from "react-native";
|
||||
|
||||
function getTextColor(hex: string): string {
|
||||
const h = hex.replace("#", "");
|
||||
const full = h.length === 3 ? h.split("").map((c) => c + c).join("") : h;
|
||||
const r = parseInt(full.slice(0, 2), 16);
|
||||
const g = parseInt(full.slice(2, 4), 16);
|
||||
const b = parseInt(full.slice(4, 6), 16);
|
||||
return (r * 299 + g * 587 + b * 114) / 1000 > 128 ? "#000000" : "#ffffff";
|
||||
}
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Video, ResizeMode } from "expo-av";
|
||||
import { spacing, borderRadius, fontSize, fontWeight } from "../theme";
|
||||
@@ -190,13 +199,7 @@ export default function ProductCard({ product, onPress, categoryColor }: Product
|
||||
<Text
|
||||
style={[
|
||||
styles.successText,
|
||||
{
|
||||
color: product.category
|
||||
?.toLowerCase()
|
||||
.includes("zipette")
|
||||
? colors.black
|
||||
: colors.white,
|
||||
},
|
||||
{ color: getTextColor(catColor) },
|
||||
]}
|
||||
>
|
||||
Ajoute !
|
||||
@@ -219,13 +222,7 @@ export default function ProductCard({ product, onPress, categoryColor }: Product
|
||||
<Text
|
||||
style={[
|
||||
styles.quickAddBtnText,
|
||||
{
|
||||
color: product.category
|
||||
?.toLowerCase()
|
||||
.includes("zipette")
|
||||
? colors.black
|
||||
: colors.white,
|
||||
},
|
||||
{ color: getTextColor(catColor) },
|
||||
]}
|
||||
>
|
||||
{isSoldOut
|
||||
|
||||
Reference in New Issue
Block a user