From 52456429f6314b386fbaaba8b5cda68c80b04157 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 6 Nov 2020 17:39:25 -0800 Subject: [PATCH] Add link to pages view. --- components/metrics/RealtimeViews.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/metrics/RealtimeViews.js b/components/metrics/RealtimeViews.js index 60d2b257..ed7797de 100644 --- a/components/metrics/RealtimeViews.js +++ b/components/metrics/RealtimeViews.js @@ -28,6 +28,15 @@ export default function RealtimeViews({ websiteId, data, websites }) { }, ]; + const renderLink = ({ x }) => { + const domain = x.startsWith('/') ? getDomain(websiteId) : ''; + return ( + + {x} + + ); + }; + const [referrers, pages] = useMemo(() => { if (pageviews) { const referrers = percentFilter( @@ -91,6 +100,7 @@ export default function RealtimeViews({ websiteId, data, websites }) { } metric={} + renderLabel={renderLink} data={pages} height={400} />