mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
feature(components): prop-type Favicon
This commit is contained in:
parent
5b80b123fa
commit
9ab3d36ced
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user