Skip to content

Commit

Permalink
[docs] Update dbv3 content (#19867)
Browse files Browse the repository at this point in the history
## Description 

DBv3 is now on Mainnet. Makes the sentence removed somewhat pointless.

## Test plan 

👀 

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
ronny-mysten authored Oct 15, 2024
1 parent 25c52c6 commit e2c7aa1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/content/snippets/deepbook.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
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 (
<>
This documentation is for <b>version {isV3 ? "3" : "2"}</b> of DeepBook. DeepBook{isV3 ? "V3" : "V2"} is currently available in {isV3 ? "Devnet and Testnet" : "Mainnet"}. For documentation on version {isV3 ? "2" : "3"} of DeepBook, see <DBLink />.
{ 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 e2c7aa1

Please sign in to comment.