Merge pull request #438 from gabehab/master

Add link to header title when appropriate
This commit is contained in:
Mike Cao 2021-01-20 18:52:12 -08:00 committed by GitHub
commit 13dddb3764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,12 +10,21 @@ import Arrow from 'assets/arrow-right.svg';
import styles from './WebsiteHeader.module.css'; import styles from './WebsiteHeader.module.css';
export default function WebsiteHeader({ websiteId, title, domain, showLink = false }) { export default function WebsiteHeader({ websiteId, title, domain, showLink = false }) {
let TitleHeader = showLink ? (
<Link href="/website/[...id]" as={`/website/${websiteId}/${title}`}>
<Favicon domain={domain} />
{title}
</Link>
) : (
<div>
<Favicon domain={domain} />
{title}
</div>
);
return ( return (
<PageHeader> <PageHeader>
<div className={styles.title}> <div className={styles.title}>{TitleHeader}</div>
<Favicon domain={domain} />
{title}
</div>
<ActiveUsers className={styles.active} websiteId={websiteId} /> <ActiveUsers className={styles.active} websiteId={websiteId} />
<ButtonLayout align="right"> <ButtonLayout align="right">
<RefreshButton websiteId={websiteId} /> <RefreshButton websiteId={websiteId} />