diff --git a/src/visits/ShortUrlVisitsHeader.js b/src/visits/ShortUrlVisitsHeader.js
index 13b381a0..a3b100a3 100644
--- a/src/visits/ShortUrlVisitsHeader.js
+++ b/src/visits/ShortUrlVisitsHeader.js
@@ -14,7 +14,7 @@ const propTypes = {
goBack: PropTypes.func.isRequired,
};
-export default function ShortUrlVisitsHeader({ shortUrlDetail, shortUrlVisits, goBack }) {
+const ShortUrlVisitsHeader = ({ shortUrlDetail, shortUrlVisits, goBack }) => {
const { shortUrl, loading } = shortUrlDetail;
const { visits } = shortUrlVisits;
const shortLink = shortUrl && shortUrl.shortUrl ? shortUrl.shortUrl : '';
@@ -47,6 +47,8 @@ export default function ShortUrlVisitsHeader({ shortUrlDetail, shortUrlVisits, g
);
-}
+};
ShortUrlVisitsHeader.propTypes = propTypes;
+
+export default ShortUrlVisitsHeader;
diff --git a/src/visits/TagVisits.js b/src/visits/TagVisits.js
index 5d9c32ef..70becba1 100644
--- a/src/visits/TagVisits.js
+++ b/src/visits/TagVisits.js
@@ -4,6 +4,7 @@ import { MercureInfoType } from '../mercure/reducers/mercureInfo';
import { SettingsType } from '../settings/reducers/settings';
import { bindToMercureTopic } from '../mercure/helpers';
import { TagVisitsType } from './reducers/tagVisits';
+import TagVisitsHeader from './TagVisitsHeader';
const propTypes = {
history: PropTypes.shape({
@@ -37,8 +38,6 @@ const TagVisits = (VisitsStats) => {
const { tag } = params;
const loadVisits = (dates) => getTagVisits(tag, dates);
- console.log(history);
-
useEffect(
bindToMercureTopic(
mercureInfo,
@@ -52,7 +51,7 @@ const TagVisits = (VisitsStats) => {
return (
- {tag} - {tagVisits.visits.length}
+
);
};
diff --git a/src/visits/TagVisitsHeader.js b/src/visits/TagVisitsHeader.js
new file mode 100644
index 00000000..e37801ff
--- /dev/null
+++ b/src/visits/TagVisitsHeader.js
@@ -0,0 +1,26 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import VisitsHeader from './VisitsHeader';
+import { TagVisitsType } from './reducers/tagVisits';
+import './ShortUrlVisitsHeader.scss';
+
+const propTypes = {
+ tagVisits: TagVisitsType.isRequired,
+ goBack: PropTypes.func.isRequired,
+};
+
+const TagVisitsHeader = ({ tagVisits, goBack }) => {
+ const { visits, tag } = tagVisits;
+
+ const visitsStatsTitle = (
+
+ Visits for {tag}
+
+ );
+
+ return ;
+};
+
+TagVisitsHeader.propTypes = propTypes;
+
+export default TagVisitsHeader;
diff --git a/src/visits/VisitsHeader.js b/src/visits/VisitsHeader.js
index 9c6d1c78..89225027 100644
--- a/src/visits/VisitsHeader.js
+++ b/src/visits/VisitsHeader.js
@@ -18,20 +18,23 @@ const propTypes = {
const VisitsHeader = ({ visits, goBack, shortUrl, children, title }) => (
-
+
- {title}
+ {title}
Visits:{' '}
- {title}
- {children}
+
+ {title}
+
+
+ {children &&
{children}
}
);