Skip to content

Commit

Permalink
Fix on reload (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceJJones authored Nov 6, 2023
1 parent 0104566 commit 4354489
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions crowdsec-docs/src/components/ConsoleAd.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import React from 'react';
import { useColorMode } from '@docusaurus/theme-common';
import React from "react";
import ThemedImage from "@theme/ThemedImage";
import useBaseUrl from "@docusaurus/useBaseUrl";

const SIGNUP_LINK = `https://app.crowdsec.net/signup${process.env.NODE_ENV === 'production' ? '?mtm_campaign=Console&mtm_source=docs&mtm_medium=tocAd&mtm_content=Console' : ''}`
const SIGNUP_LINK = `https://app.crowdsec.net/signup${
process.env.NODE_ENV === "production"
? "?mtm_campaign=Console&mtm_source=docs&mtm_medium=tocAd&mtm_content=Console"
: ""
}`;
export default function ConsoleAd() {
const { colorMode } = useColorMode();
return (
<a href={SIGNUP_LINK} target="_blank">
<img src={colorMode === "dark" ? "/img/console_ad_dark.svg" : "/img/console_ad_light_alt.svg"} alt="CrowdSec Console" width="100%" />
<ThemedImage
alt="CrowdSec Console"
sources={{
light: useBaseUrl("/img/console_ad_light_alt.svg"),
dark: useBaseUrl("/img/console_ad_dark.svg"),
}}
width="100%"
/>
</a>
);
}
}

0 comments on commit 4354489

Please sign in to comment.