Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

fix: logo text

AykutSarac537ac3fbc98b
diff --git a/src/layout/JsonCrackLogo/index.tsx b/src/layout/JsonCrackLogo/index.tsx
index 5b07b454..4d6dfcb3 100644
--- a/src/layout/JsonCrackLogo/index.tsx
+++ b/src/layout/JsonCrackLogo/index.tsx
@@ -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>
);
};
diff --git a/src/lib/utils/widget.ts b/src/lib/utils/widget.ts
index 6e6d61b1..3e336b63 100644
--- a/src/lib/utils/widget.ts
+++ b/src/lib/utils/widget.ts
@@ -1,6 +1,5 @@
export function isIframe() {
try {
- if (window === undefined) return false;
return window.self !== window.top;
} catch (e) {
return true;