Skip to content

Commit

Permalink
fix: Add Link import and update link URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlesdoiron committed Mar 7, 2024
1 parent 5e44b99 commit af90d9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions frontend-next/src/components/hero-banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AppStoreLink } from './AppStoreLink';
import { GoogleStoreLink } from './GoogleStoreLink';
import { MatomoService } from '@/services/matomo';
import qrCode from '@/images/qr-code.svg';
import Link from 'next/link';

function BackgroundIllustration(props: React.ComponentPropsWithoutRef<'div'>) {
let id = useId();
Expand Down Expand Up @@ -98,7 +99,7 @@ export function Hero() {
className='animate-pulse'
/>
</div>
<div className=' flex flex-col justify-center mx-auto items-start'>
<div className='flex flex-col justify-center mx-auto items-start'>
<p className='text-md text-app-primary '>
Scannez ici
<br /> pour télécharger l'application.
Expand Down Expand Up @@ -150,14 +151,14 @@ export function Hero() {
Les recommandations sont issues de sources fiables et validés par
le Haut conseil de santé publique et Santé publique France.
</p>
<a
<Link
onClick={() => MatomoService.trackClick('go-to-web-version')}
href='https://frontend-recosante-preprod.dev.fabrique.social.gouv.fr'
href='/'
target='_blank'
className='border-b text-center text-sm text-gray-500 lg:text-left '
>
Accéder à la version web
</a>
</Link>
</div>
</div>
</Container>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/layout/embed/Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ export default function Code(props) {
let location = useLocation();
const { theme } = useContext(StyleContext);
const [script, setScript] = useState("");
const URL = "www.recosante.beta.gouv.fr";

useEffect(() => {
setScript(
`<script id="${props.id || "widget-recosante"}" src="${
window.location.origin
URL
}/iframe.js" data-search="${
props.typeShare === "result" ? location.pathname.substring(1) : ""
}?theme=${theme}"></script>`
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/widget/Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const Text = styled.textarea`
cursor: copy;
`;


const URL = "www.recosante.beta.gouv.fr";
export default function Code(props) {
let location = useLocation();
const { theme } = useContext(StyleContext);
Expand All @@ -47,7 +49,7 @@ export default function Code(props) {
useEffect(() => {
setScript(
`<script id="widget-recosante" src="${
window.location.origin
URL
}/iframe.js" data-search="${
props.defaultPlace
? formatPlaceUrl(props.defaultPlace).substring(1)
Expand Down

0 comments on commit af90d9b

Please sign in to comment.