diff --git a/mon-entreprise/source/components/Feedback/PageFeedback.tsx b/mon-entreprise/source/components/Feedback/PageFeedback.tsx index 61689d98b..c98cc692d 100644 --- a/mon-entreprise/source/components/Feedback/PageFeedback.tsx +++ b/mon-entreprise/source/components/Feedback/PageFeedback.tsx @@ -13,7 +13,7 @@ type PageFeedbackProps = { } const localStorageKey = (feedback: [string, string]) => - `app::feedback::${feedback.join('::')}` + `app::feedback::v2::${feedback.join('::')}` const saveFeedbackOccurrenceInLocalStorage = ([name, path, rating]: [ string, string, @@ -29,7 +29,6 @@ const feedbackAlreadyGiven = (feedback: [string, string]) => { } export default function PageFeedback({ - blacklist = [], customMessage, customEventName }: PageFeedbackProps) { @@ -73,11 +72,6 @@ export default function PageFeedback({ if (state.feedbackAlreadyGiven && !state.showForm && !state.showThanks) { return null } - const pathname = location.pathname === '/' ? '' : location.pathname - - if (blacklist.includes(pathname)) { - return null - } return (
{ + const currentPath = useLocation().pathname + const sitePath = useContext(SitePathsContext) + const simulators = useSimulatorsData() + if ( + [ + simulators['aide-déclaration-indépendant'], + simulators['comparaison-statuts'], + simulators['demande-mobilité'] + ] + .map(s => s.path) + .includes(currentPath) + ) { + return true + } + return ![ + sitePath.index, + ...Object.values(simulators).map(s => s.path) + ].includes(currentPath) +} const Footer = () => { const sitePaths = useContext(SitePathsContext) + const showFeedback = useShowFeedback() const hrefLink = hrefLangLink[i18n.language as AvailableLangs][ decodeURIComponent( @@ -46,10 +58,7 @@ const Footer = () => { ))}