Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
ronny-mysten committed Oct 15, 2024
1 parent fd88f9d commit 989cb41
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/content/snippets/deepbook.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
import React, { useState, useEffect } from "react";
import { useLocation } from "@docusaurus/router";
import useGlobalData from '@docusaurus/useGlobalData';
import Link from '@docusaurus/Link';

export function DBV() {
const [showNotice, setShowNotice] = useState(false);
const location = useLocation();
const isV3 = location.pathname.includes("v3");
useEffect(() => {
const currentDate = new Date();
const endDate = new Date("2024-10-31T23:59:59");
// Don't show after October; remove if still here
if (currentDate <= endDate) {
setShowNotice(true);
} else {
setShowNotice(false);
}
}, []);


function DBLink() {
return <Link href={isV3 ? "/standards/deepbookv2" : "/standards/deepbookv3"}>DeepBook{isV3 ? "V2" : "V3"} docs</Link>
}

return (
<>
<p>DeepBookV3 is now available on Mainnet!</p>
{ showNotice ? <p>DeepBookV3 is now available on Mainnet!</p> : "" }
<p>This documentation is for <b>version {isV3 ? "3" : "2"}</b> of DeepBook. For documentation on version {isV3 ? "2" : "3"} of DeepBook, see <DBLink />.
</p>
</>
Expand Down

0 comments on commit 989cb41

Please sign in to comment.