diff --git a/src/pages/contribution-page/contribution-card.tsx b/src/pages/contribution-page/contribution-card.tsx index 0b7be5a..0af1972 100644 --- a/src/pages/contribution-page/contribution-card.tsx +++ b/src/pages/contribution-page/contribution-card.tsx @@ -55,7 +55,7 @@ const ContributionItem = ({ 70 - ? `${data.message.slice(0, 70)}...` + ? `${data.message.slice(0, 300)}...` : data.message } highlightedQuery={highlightedQuery} diff --git a/src/pages/contribution-page/index.tsx b/src/pages/contribution-page/index.tsx index 6739d40..d809791 100644 --- a/src/pages/contribution-page/index.tsx +++ b/src/pages/contribution-page/index.tsx @@ -25,6 +25,7 @@ const ContributionPage: React.FC = () => { const [highlightedQuery, setHighlightedQuery] = useState(""); const location = useLocation(); + console.log(location.pathname); const { data, isLoading, isError } = useGetContributionData( buildURL(sort, status, query, page, searchInMessage), @@ -63,7 +64,11 @@ const ContributionPage: React.FC = () => { return ( - Contribution par objets + {location.pathname.includes("contributionpage") ? ( + Contribution par objets + ) : ( + Contribution via formulaire + )} { + const location = useLocation(); + const contributorClassName = location.pathname.includes("contributionpage") + ? "contributorSide" + : "contributorSideContact"; return ( <> - + {data.id && ( +
+
{JSON.stringify(data || "", null, 2)}
+
); diff --git a/src/pages/contribution-page/staff-action.tsx b/src/pages/contribution-page/staff-action.tsx index 09fb9bc..4c6635c 100644 --- a/src/pages/contribution-page/staff-action.tsx +++ b/src/pages/contribution-page/staff-action.tsx @@ -1,10 +1,15 @@ import { Col, Text } from "@dataesr/dsfr-plus"; import EmailSender from "../../api/send-mail"; import type { Contribution } from "../../types"; +import { useLocation } from "react-router-dom"; const StaffActions = ({ data }: { data: Contribution }) => { + const location = useLocation(); + const contributorClassName = location.pathname.includes("contributionpage") + ? "staffSide" + : "staffSideContact"; return ( - + {data.comment && RĂ©ponse : {data.comment}} diff --git a/src/pages/contribution-page/styles.scss b/src/pages/contribution-page/styles.scss index 97a5ae6..7676f8d 100644 --- a/src/pages/contribution-page/styles.scss +++ b/src/pages/contribution-page/styles.scss @@ -6,6 +6,14 @@ margin-right: 200px; padding: 20px; } +.contributorSideContact { + background-color: var(--background-alt-brown-caramel); + border: 1px solid var(--background-alt-brown-caramel); + border-radius: 10px; + margin-bottom: 10px; + margin-right: 200px; + padding: 20px; +} .staffSide { text-align: right; background-color: var(--background-alt-pink-macaron); @@ -13,6 +21,13 @@ padding: 20px; margin-left: 140px; } +.staffSideContact { + text-align: right; + background-color: var(--background-alt-blue-cumulus); + border-radius: 20px; + padding: 20px; + margin-left: 140px; +} .contributionItem { border-bottom: 10px solid #ccc;