Skip to content

Commit

Permalink
fix: useless push (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoanRos authored Jan 9, 2024
1 parent 0d9ae9a commit cd6e1a8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 53 deletions.
19 changes: 2 additions & 17 deletions components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
LINKEDIN_URL,
} from "../constants"
import ContactPopup from "./ContactPopup"
import { push } from "@socialgouv/matomo-next"

export default function Footer() {
const [showContactPopup, setShowContactPopup] = useState(false)
Expand Down Expand Up @@ -103,28 +102,14 @@ export default function Footer() {
<div className="w-1/4 mt-3 mb-5 border-b border-green-300" />
</div>
<div className="grid grid-flow-col gap-6 max-w-md">
<a
href={ANDROID_URL}
target="_blank"
rel="noopener noreferrer"
onClick={() =>
push(["trackEvent", "Download", "Android", "Footer"])
}
>
<a href={ANDROID_URL} target="_blank" rel="noopener noreferrer">
<img
className="object-contain"
src={`${baseUrl}/images/other/google-play-fr.png`}
alt="Disponible sur Google Play"
/>
</a>
<a
href={IOS_URL}
target="_blank"
rel="noopener noreferrer"
onClick={() =>
push(["trackEvent", "Download", "iOS", "Footer"])
}
>
<a href={IOS_URL} target="_blank" rel="noopener noreferrer">
<img
className="object-contain"
src={`${baseUrl}/images/other/app-store-fr.png`}
Expand Down
6 changes: 0 additions & 6 deletions components/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { AiOutlineClose } from "react-icons/ai"
import Fade from "@mui/material/Fade"
import { HiMenu } from "react-icons/hi"
import ContactPopup from "./ContactPopup"
import { push } from "@socialgouv/matomo-next"

import { ANDROID_URL, IOS_URL } from "../constants"

export default function Navigation({ showPopup, setShowPopup }) {
Expand Down Expand Up @@ -146,9 +144,6 @@ export const DownloadPopup = ({ showPopup, setShowPopup }) => {
tabIndex={1}
target="_blank"
rel="noopener noreferrer"
onClick={() =>
push(["trackEvent", "Download", "android", "Modale"])
}
>
<img
className="object-contain w-full"
Expand All @@ -161,7 +156,6 @@ export const DownloadPopup = ({ showPopup, setShowPopup }) => {
tabIndex={1}
target="_blank"
rel="noopener noreferrer"
onClick={() => push(["trackEvent", "Download", "iOS", "Modale"])}
>
<img
className="object-contain w-full"
Expand Down
15 changes: 2 additions & 13 deletions pages/blog/[blog].js
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,21 @@ import styles from "../../style/bloga.module.css"
import { ANDROID_URL, IOS_URL } from "../../constants"
import appStorePic from "../../public/images/other/app-store-fr.png"
import googlePlayPic from "../../public/images/other/google-play-fr.png"
import { push } from "@socialgouv/matomo-next"

const Blog = ({ mdxSource, data }) => {
const [showPopup, setShowPopup] = useState(false)

const components = {
DownloadButtons: () => (
<div className="mb-1 grid max-w-[200px] sm:max-w-[400px] sm:grid-flow-col gap-6 auto-cols-fr md:w-5/6 m-auto">
<a
href={ANDROID_URL}
target="_blank"
rel="noopener noreferrer"
onClick={() => push(["trackEvent", "Download", "Android", "Blog"])}
>
<a href={ANDROID_URL} target="_blank" rel="noopener noreferrer">
<img
className="object-contain w-full"
src={googlePlayPic.src}
alt="télécharger dans Google Play"
/>
</a>
<a
href={IOS_URL}
target="_blank"
rel="noopener noreferrer"
onClick={() => push(["trackEvent", "Download", "iOS", "Blog"])}
>
<a href={IOS_URL} target="_blank" rel="noopener noreferrer">
<img
className="object-contain w-full"
src={appStorePic.src}
Expand Down
19 changes: 2 additions & 17 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Footer from "../components/Footer"
import Navigation, { DownloadPopup } from "../components/Navigation"
import { ANDROID_URL, IOS_URL } from "../constants"
import { useState } from "react"
import { push } from "@socialgouv/matomo-next"

export default function Index() {
const [showPopup, setShowPopup] = useState(false)
Expand All @@ -22,28 +21,14 @@ export default function Index() {
L'application mobile pour maitriser sa consommation d'alcool
</p>
<div className="grid grid-flow-col gap-3 sm:gap-6 max-w-sm mb-7 mx-auto md:mx-0">
<a
href={ANDROID_URL}
target="_blank"
rel="noopener noreferrer"
onClick={() =>
push(["trackEvent", "Download", "android", "MainPage"])
}
>
<a href={ANDROID_URL} target="_blank" rel="noopener noreferrer">
<img
className="object-contain w-full"
src="images/other/google-play-fr.png"
alt="disponible sur google play"
/>
</a>
<a
href={IOS_URL}
target="_blank"
rel="noopener noreferrer"
onClick={() =>
push(["trackEvent", "Download", "iOS", "MainPage"])
}
>
<a href={IOS_URL} target="_blank" rel="noopener noreferrer">
<img
className="object-contain w-full"
src="images/other/app-store-fr.png"
Expand Down

0 comments on commit cd6e1a8

Please sign in to comment.