diff --git a/Dockerfile b/Dockerfile index ecac0d5..e1e1cda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:16-bullseye AS build ENV POSTGRES_URL='postgresql://fedisearch:passwd@postgres:5432/fedisearch?schema=public' \ - NEXT_PUBLIC_MATOMO_URL='' \ - NEXT_PUBLIC_MATOMO_SITE_ID='' \ + MATOMO_URL='' \ + MATOMO_SITE_ID='' \ TZ='UTC' WORKDIR /srv COPY application/package*.json ./ diff --git a/application/src/components/Avatar.tsx b/application/src/components/Avatar.tsx index a67a520..866cbc3 100644 --- a/application/src/components/Avatar.tsx +++ b/application/src/components/Avatar.tsx @@ -1,7 +1,6 @@ import React from 'react' -import { FeedResponseItem } from '../types/FeedResponse' -const Avatar:React.FC<{feed:FeedResponseItem}> = ({ feed }) => { +const Avatar:React.FC<{url:string|null|undefined}> = ({ url }) => { const fallbackImage = '/avatar.svg' const handleAvatarImageError = (event) => { @@ -11,7 +10,7 @@ const Avatar:React.FC<{feed:FeedResponseItem}> = ({ feed }) => { return ( diff --git a/application/src/components/Layout.tsx b/application/src/components/Layout.tsx index 866bc0a..b2aefa5 100644 --- a/application/src/components/Layout.tsx +++ b/application/src/components/Layout.tsx @@ -1,13 +1,14 @@ import React, { useEffect } from 'react' import Head from 'next/head' -import { tracker } from '../lib/matomo' import Footer from './Footer' +import getMatomo from '../lib/getMatomo' +import { UserOptions } from '@datapunt/matomo-tracker-js/es/types' export const siteTitle = 'FediSearch' -const Layout:React.FC<{ children: React.ReactNode }> = ({ children }) => { +const Layout:React.FC<{ matomoConfig:UserOptions, children: React.ReactNode }> = ({ matomoConfig, children }) => { useEffect(() => { - tracker.trackPageView() + getMatomo(matomoConfig).trackPageView() }) return (