Skip to content

Commit

Permalink
fix(contributor-requests): add red icon if export false
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Jun 13, 2024
1 parent 8ac3b1d commit 27fcf35
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Col } from "@dataesr/dsfr-plus";
import React, { useState } from "react";
import { FaShoppingCart, FaCopy } from "react-icons/fa";
import { Production } from "../../../types";
import SelectWithNames from "./name-selector";
import { ExternalLinks } from "./external-links";
import { useDataList } from "./data-list-context";
import "./styles.scss"; // Importez vos styles CSS ou SCSS
import { Col } from "@dataesr/dsfr-plus";
import "./styles.scss";

const ContributorRequests: React.FC<{
data: {
Expand All @@ -23,14 +23,17 @@ const ContributorRequests: React.FC<{
setCopiedId(text);
setTimeout(() => {
setCopiedId(null);
}, 2000); // Efface l'ID copié après 2 secondes
}, 2000);
});
};

return (
<>
{data.productions.map((production) => {
const isCopied = copiedId === production.id;
const hasExport = dataList.find(
(item) => item.publi_id === production.id
)?.export;

return (
<Col
Expand All @@ -50,8 +53,13 @@ const ContributorRequests: React.FC<{
{isCopied && <span className="copied-text">Copié</span>}
<FaCopy size={14} color="#2196f3" className="copy-icon" />
</button>
{dataList.find((item) => item.publi_id === production.id)
?.export && (
{hasExport === false && (
<FaShoppingCart
className="fr-ml-2w cart-icon red-cart"
color="red"
/>
)}
{hasExport && (
<FaShoppingCart
className="fr-ml-2w cart-icon"
color="#21AB8E"
Expand Down

0 comments on commit 27fcf35

Please sign in to comment.