-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97a144d
commit cb9671e
Showing
3 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
import { FC, HTMLProps } from "react"; | ||
import styles from "./logo.module.scss"; | ||
import rebrandingConfig from "@repo/scripts/rebrand.config.json"; | ||
|
||
const { repo } = rebrandingConfig; | ||
|
||
interface LogoProps { | ||
export interface LogoProps { | ||
href?: string; | ||
linkComponent?: React.ElementType; | ||
} | ||
|
||
/** | ||
* # Logo | ||
* | ||
*/ | ||
export function Logo({ href }: LogoProps) { | ||
export function Logo({ href, linkComponent }: LogoProps) { | ||
if (href?.startsWith("http")) | ||
return ( | ||
<a href={href} target="_blank" rel="noopener noreferrer" className={styles.logo}> | ||
<span>{repo}</span> | ||
</a> | ||
); | ||
const Link = (linkComponent || "a") as FC<{ to?: string } & HTMLProps<HTMLAnchorElement>>; | ||
return ( | ||
<a href={href ?? "/"} target="_blank" rel="noopener noreferrer" className={styles.logo}> | ||
<Link href={href ?? "/"} to={href ?? "/"} rel="noopener noreferrer" className={styles.logo}> | ||
<span>{repo}</span> | ||
</a> | ||
</Link> | ||
); | ||
} |