diff --git a/src/layout/JsonCrackLogo/index.tsx b/src/layout/JsonCrackLogo/index.tsx index 5b07b45..4d6dfcb 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 = ({ fontSize = "1.2rem", ...props }) => { + const logoText = React.useMemo(() => { + if (typeof window === "undefined") return "JSON CRACK"; + return isIframe() ? "JC" : "JSON CRACK"; + }, []); + return ( - {isIframe() ? "JC" : "JSON CRACK"} + {logoText} ); }; diff --git a/src/lib/utils/widget.ts b/src/lib/utils/widget.ts index 6e6d61b..3e336b6 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;