fix: logo text

This commit is contained in:
AykutSarac 2024-02-03 13:11:33 +03:00
parent a26cc56172
commit 537ac3fbc9
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View File

@ -20,9 +20,14 @@ interface LogoProps extends React.ComponentPropsWithoutRef<"a"> {
}
export const JSONCrackLogo: React.FC<LogoProps> = ({ fontSize = "1.2rem", ...props }) => {
const logoText = React.useMemo(() => {
if (typeof window === "undefined") return "JSON CRACK";
return isIframe() ? "JC" : "JSON CRACK";
}, []);
return (
<StyledTitle as={Link} fontSize={fontSize} href="/" prefetch={false} {...props}>
{isIframe() ? "JC" : "JSON CRACK"}
{logoText}
</StyledTitle>
);
};

View File

@ -1,6 +1,5 @@
export function isIframe() {
try {
if (window === undefined) return false;
return window.self !== window.top;
} catch (e) {
return true;