diff --git a/src/routes/Liste/List/ResistantRow.tsx b/src/routes/Liste/List/ResistantRow.tsx index 4d8148a..b59c7d1 100644 --- a/src/routes/Liste/List/ResistantRow.tsx +++ b/src/routes/Liste/List/ResistantRow.tsx @@ -1,7 +1,8 @@ import { useNavigate } from "react-router"; -import { isAncienResistant, Resistant } from "../../../Resistant"; +import { Resistant } from "../../../Resistant"; import { getResistantPhotoUrl } from "../../../getResistantPhotoUrl"; import { Separator } from "../../../components/Separator"; +import { getResistantGrayscaleRule } from "../../../style/getResistantGrayscaleRule"; interface Props { resistant: Resistant; @@ -39,11 +40,9 @@ export const ResistantRow = ({ resistant }: Props) => { src={getResistantPhotoUrl(resistant)} alt={resistant.noms} style={{ + ...getResistantGrayscaleRule(resistant), width: "200px", height: "200px", - filter: `grayscale(${ - isAncienResistant(resistant) ? "80%" : "1" - })`, }} /> diff --git a/src/routes/Liste/Map/PopupContent.tsx b/src/routes/Liste/Map/PopupContent.tsx index 4841c68..a1db4c3 100644 --- a/src/routes/Liste/Map/PopupContent.tsx +++ b/src/routes/Liste/Map/PopupContent.tsx @@ -4,6 +4,7 @@ import { isAncienResistant, Resistant } from "../../../Resistant"; import { getResistantPhotoUrl } from "../../../getResistantPhotoUrl"; import { HomeContext } from "../../../context/HomeContext"; import { getResistantPageUrl } from "../../../getResistantPageUrl"; +import { getResistantGrayscaleRule } from "../../../style/getResistantGrayscaleRule"; export const PopupContent = ({ resistant }: { resistant: Resistant }) => { const navigate = useNavigate(); @@ -21,10 +22,10 @@ export const PopupContent = ({ resistant }: { resistant: Resistant }) => { diff --git a/src/routes/Liste/Thumbs/ResistantThumb.tsx b/src/routes/Liste/Thumbs/ResistantThumb.tsx index f00ffae..0574a59 100644 --- a/src/routes/Liste/Thumbs/ResistantThumb.tsx +++ b/src/routes/Liste/Thumbs/ResistantThumb.tsx @@ -1,10 +1,11 @@ import { useNavigate } from "react-router"; import { BackgroundImage, Text } from "@mantine/core"; import { getResistantPhotoUrl } from "../../../getResistantPhotoUrl"; -import { isAncienResistant, Resistant } from "../../../Resistant"; +import { Resistant } from "../../../Resistant"; import React from "react"; import { HomeContext } from "../../../context/HomeContext"; import { getResistantPageUrl } from "../../../getResistantPageUrl"; +import { getResistantGrayscaleRule } from "../../../style/getResistantGrayscaleRule"; interface Props { resistant: Resistant; @@ -18,9 +19,7 @@ export const ResistantThumb = ({ resistant }: Props) => { ({ + filter: `grayscale(${isAncienResistant(resistant) ? "40%" : "0"})`, +});