Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

feature(components): prop-type Favicon

Alexander Klein9ab3d36ced1c
diff --git a/components/common/Favicon.js b/components/common/Favicon.js
index 07ec696cb..d72cd3c7a 100644
--- a/components/common/Favicon.js
+++ b/components/common/Favicon.js
@@ -1,4 +1,5 @@
import React from 'react';
+import PropTypes from 'prop-types';
import styles from './Favicon.module.css';
function getHostName(url) {
@@ -6,7 +7,7 @@ function getHostName(url) {
return match && match.length > 1 ? match[1] : null;
}
-export default function Favicon({ domain, ...props }) {
+function Favicon({ domain, ...props }) {
const hostName = domain ? getHostName(domain) : null;
return hostName ? (
@@ -19,3 +20,9 @@ export default function Favicon({ domain, ...props }) {
/>
) : null;
}
+
+Favicon.propTypes = {
+ domain: PropTypes.string,
+};
+
+export default Favicon;