xinnni's picture
Upload 146 files
f909d7c verified
raw
history blame
822 Bytes
import React from "react";
import { Flex } from "@mantine/core";
import { JSONCrackLogo } from "src/layout/JsonCrackLogo";
import { isIframe } from "src/lib/utils/widget";
import * as Styles from "./styles";
export const Logo = () => {
const [logoURL, setLogoURL] = React.useState("");
React.useEffect(() => {
if (typeof window !== "undefined") {
const url = !isIframe()
? "https://jsoncrack.com"
: window.location.href.replace("widget", "editor");
setLogoURL(url);
}
}, []);
if (!logoURL) return null;
return (
<Styles.StyledToolElement title="JSON Crack">
<Flex gap="xs" align="center" justify="center">
<JSONCrackLogo fontSize="1.2em" href={logoURL} target={isIframe() ? "_blank" : "_parent"} />
</Flex>
</Styles.StyledToolElement>
);
};