diff --git a/mon-entreprise/cypress/integration/mon-entreprise/simulateurs.js b/mon-entreprise/cypress/integration/mon-entreprise/simulateurs.js index 853f60101..08b6f967b 100644 --- a/mon-entreprise/cypress/integration/mon-entreprise/simulateurs.js +++ b/mon-entreprise/cypress/integration/mon-entreprise/simulateurs.js @@ -127,8 +127,8 @@ describe('Simulateur salarié mode partagé', () => { cy.wait(1000) cy.get('.step').find('input[value="\'CDD\'"]').click({ force: true }) cy.wait(1000) - cy.get('button.shareButton').click() - cy.get('.overlayContent textarea') + cy.contains('Générer un lien').click() + cy.get('.shareableLink') .invoke('val') .should('eq', Cypress.config().baseUrl + urlWithState) }) diff --git a/mon-entreprise/source/components/Banner.css b/mon-entreprise/source/components/Banner.css index 36632117e..5b4e39249 100644 --- a/mon-entreprise/source/components/Banner.css +++ b/mon-entreprise/source/components/Banner.css @@ -21,6 +21,10 @@ border-radius: 15px; } +.ui__.banner p { + flex-grow: 1; +} + .ui__.banner.news img { vertical-align: middle !important; top: 4px; diff --git a/mon-entreprise/source/components/ShareSimulationBanner.tsx b/mon-entreprise/source/components/ShareSimulationBanner.tsx index 927fac65e..a86c92ce0 100644 --- a/mon-entreprise/source/components/ShareSimulationBanner.tsx +++ b/mon-entreprise/source/components/ShareSimulationBanner.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' -import Overlay from './Overlay' +import Animate from 'Components/ui/animate' import Banner from './Banner' import { LinkButton } from 'Components/ui/Button' @@ -12,7 +12,7 @@ export default function ShareSimulationBanner({ const [opened, setOpened] = useState(false) const { t } = useTranslation() - if (typeof window === 'undefined') return null + const shareAPIAvailable = !!window?.navigator?.share const getUrl = () => [ @@ -22,11 +22,8 @@ export default function ShareSimulationBanner({ getShareSearchParams().toString(), ].join('') - const handleClose = () => { - setOpened(false) - } const onClick = () => { - if (window.navigator.share) { + if (shareAPIAvailable) { window.navigator.share({ title: document.title, text: t( @@ -41,66 +38,81 @@ export default function ShareSimulationBanner({ } return ( -