You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
822 B
30 lines
822 B
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>
|
|
);
|
|
};
|