website: add greenhouse

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-11-17 11:12:36 +01:00
parent 828895195e
commit 53baa806d9
2 changed files with 44 additions and 3 deletions

View File

@ -41,9 +41,9 @@ module.exports = {
position: "left", position: "left",
}, },
{ {
to: "api/", to: "jobs/",
activeBasePath: "api", activeBasePath: "jobs",
label: "API", label: "Jobs",
position: "left", position: "left",
}, },
{ {

View File

@ -0,0 +1,41 @@
import React from "react";
import Layout from "@theme/Layout";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import { useEffect } from "react";
import { useColorMode } from "@docusaurus/theme-common";
const useScript = (url, selector = "body", async = true) => {
useEffect(() => {
const element = document.querySelector(selector);
const script = document.createElement("script");
script.src = url;
script.async = async;
element.appendChild(script);
return () => {
element.removeChild(script);
};
}, [url]);
};
function JobBoardWrapper() {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;
return (
<Layout title="Jobs" description={siteConfig.tagline}>
<JobBoard />
</Layout>
);
}
function JobBoard() {
useScript(
"https://boards.greenhouse.io/embed/job_board/js?for=authentiksecurity"
);
const { colorMode, setColorMode } = useColorMode();
if (colorMode !== "light") {
setColorMode("light");
}
return <div id="grnhse_app"></div>;
}
export default JobBoardWrapper;