diff --git a/content/docs.page.tsx b/content/docs.page.tsx index 4248f3421a..e2fe0fddd1 100644 --- a/content/docs.page.tsx +++ b/content/docs.page.tsx @@ -2,89 +2,227 @@ import * as React from 'react'; import { useTranslate } from '@portal/hooks'; const recommendedPages = [ - { - "description": "rippled API Reference", - "link": "./manage-the-rippled-server.html", - }, - { - "description": "XRP Faucet", - "link": "./xrp-testnet-faucet.html", - }, - { - "description": "Getting Started with Python", - "link": "./get-started-using-python.html#get-started-using-python", - }, - { - "description": "Websocket API Tool", - "link": "./websocket-api-tool.html", - }, - { "description": "XRP Ledger Explorer", "link": "https://livenet.xrpl.org" }, - ] ; + { + description: 'rippled API Reference', + link: './manage-the-rippled-server.html', + }, + { + description: 'XRP Faucet', + link: './xrp-testnet-faucet.html', + }, + { + description: 'Getting Started with Python', + link: './get-started-using-python.html#get-started-using-python', + }, + { + description: 'Websocket API Tool', + link: './websocket-api-tool.html', + }, + { description: 'XRP Ledger Explorer', link: 'https://livenet.xrpl.org' }, +]; const useCases = [ - { - "title": "On-Chain Finance", - "id": "on-chain-finance-use-cases", - "imgClass": "wallet-illustration", - "subItems": [ - { - "description": "Trade on the decentralized exchange", - "link": "./trade-in-the-decentralized-exchange.html", - }, - { - "description": "Make payments", - "link": "./send-xrp.html", - }, - { - "description": "Use specialized payment types", - "link": "./use-specialized-payment-types.html" - } - ], - }, - { - "title": "Tokens", - "id": "token-use-cases", - "imgClass": "token-illustration", - "subItems": [ - { - "description": "Non-fungible Tokens", - "link": "./non-fungible-tokens.html", - }, - { - "description": "Issue a stablecoin", - "link": "./issue-a-fungible-token.html", - }, - { - "description": "Assign an authorized minter", - "link": "./assign-an-authorized-minter-using-javascript.html", - }, - ], - }, - { - "title": "Payments", - "id": "payments-use-cases", - "imgClass": "connections-illustration", - "subItems": [ - { - "description": "Peer to peer payments", - "link": "./direct-xrp-payments.html", - }, - { - "description": "Cross-currency payments", - "link": "./cross-currency-payments.html", - }, - { - "description": "Escrows", - "link": "./escrow.html", - }, - ], - }, - ] - ; + { + title: 'On-Chain Finance', + id: 'on-chain-finance-use-cases', + imgClass: 'wallet-illustration', + subItems: [ + { + description: 'Trade on the decentralized exchange', + link: './trade-in-the-decentralized-exchange.html', + }, + { + description: 'Make payments', + link: './send-xrp.html', + }, + { + description: 'Use specialized payment types', + link: './use-specialized-payment-types.html', + }, + ], + }, + { + title: 'Tokens', + id: 'token-use-cases', + imgClass: 'token-illustration', + subItems: [ + { + description: 'Non-fungible Tokens', + link: './non-fungible-tokens.html', + }, + { + description: 'Issue a stablecoin', + link: './issue-a-fungible-token.html', + }, + { + description: 'Assign an authorized minter', + link: './assign-an-authorized-minter-using-javascript.html', + }, + ], + }, + { + title: 'Payments', + id: 'payments-use-cases', + imgClass: 'connections-illustration', + subItems: [ + { + description: 'Peer to peer payments', + link: './direct-xrp-payments.html', + }, + { + description: 'Cross-currency payments', + link: './cross-currency-payments.html', + }, + { + description: 'Escrows', + link: './escrow.html', + }, + ], + }, +]; +const intermediateVideos = [ + { + src: require('./static/img/backgrounds/docs-advanced-payment-features@2x.png'), + title: 'Advanced Payment Features', + url: 'https://www.youtube.com/embed/e2Iwsk37LMk?rel=0&showinfo=0&autoplay=1', + }, + { + src: require('./static/img/backgrounds/docs-governance@2x.png'), + title: 'Governance and the Amendment Process', + url: 'https://www.youtube.com/embed/4GbRdanHoR4?rel=0&showinfo=0&autoplay=1', + }, + { + src: require('./static/img/backgrounds/docs-sidechains@2x.png'), + title: 'Federated Sidechains', + url: 'https://www.youtube.com/embed/NhH4LM8NxgY?rel=0&showinfo=0&autoplay=1', + }, +]; +const getStartedVideos = [ + { + src: require('./static/img/backgrounds/docs-intro-to-XRP-ledger@2x.png'), + title: 'Intro to XRP Ledger', + url: 'https://www.youtube.com/embed/sVTybJ3cNyo?rel=0&showinfo=0&autoplay=1', + }, + { + src: require('./static/img/backgrounds/docs-accounts@2x.png'), + title: 'Accounts', + url: 'https://www.youtube.com/embed/eO8jE6PftX8?rel=0&showinfo=0&autoplay=1', + }, + { + src: require('./static/img/backgrounds/docs-decentralized-exchange@2x.png'), + title: 'Decentralized Exchange', + url: 'https://www.youtube.com/embed/VWNrHBDfXvA?rel=0&showinfo=0&autoplay=1', + }, + { + src: require('./static/img/backgrounds/docs-tokenization@2x.png'), + title: 'Tokenization', + url: 'https://www.youtube.com/embed/Oj4cWOiWf4A?rel=0&showinfo=0&autoplay=1', + }, +]; -const test = "./assets/img/backgrounds/docs-intro-to-XRP-ledger@2x.png"; +const devTools = [ + { + title: 'Faucets', + link: './xrp-testnet-faucet.html', + description: 'Get credentials and test-XRP for XRP Ledger Testnet or Devnet.', + }, + { + title: 'WebSocket Tool', + link: './websocket-api-tool.html', + description: 'Send sample requests and get responses from the rippled API.', + }, + { + title: 'XRP Ledger Explorer', + link: 'https://livenet.xrpl.org', + description: + 'View validations of new ledger versions in real-time, chart the location of servers in the XRP Ledger.', + }, + { + title: 'Transaction Sender', + link: './tx-sender.html', + description: + 'Test how your code handles various XRP Ledger transactions by sending them over the Testnet to the address.', + }, +]; +const test = './assets/img/backgrounds/docs-intro-to-XRP-ledger@2x.png'; -const target= {prefix: ''}; // TODO: fixme +const target = { prefix: '' }; // TODO: fixme + +function UseCasesCard(props: { + useCase: { + id: string; + title: string; + imgClass: string; + subItems: { description: string; link: string }[]; + }; +}) { + const { useCase } = props; + return ( +
+ {useCase.title} +
{useCase.title}
+ +
+ ); +} + +function FlatCard(props: { href: string; title: string; description: string; linkText: string; imgClass }) { + const { title, description, linkText, href, imgClass } = props; + return ( + + {title} +
+
{title}
+
+

{description}

+
+
+ {linkText} +
+
+
+ ); +} + +function VideoCard(props: { url: string; title: string; src: string }) { + const { url, title, src } = props; + return ( +
+ + {title} +
{title}
+
+
+ ); +} + +function DevToolCard(props: { link: string; title: string; description: string }) { + const { translate } = useTranslate(); + const { link, title, description } = props; + return ( + +
{translate(title)}
+

{translate(description)}

+
+ ); +} + +function PrimaryButton(props: { href: string; text: string; isArrowUp: boolean }) { + const { href, text, isArrowUp } = props; + return ( + + {text} + + ); +} export default function Docs() { const { translate } = useTranslate(); @@ -92,285 +230,197 @@ export default function Docs() { return (
-
-
+
+
-

{translate("XRP Ledger Developer Resources")}

-
{translate("Documentation")}
+

{translate('XRP Ledger Developer Resources')}

+
{translate('Documentation')}
-
-
- {'{'}# Macros #{'}'} - $$ macro primaryButton(href, text, isArrowUp) $$ - $$ if isArrowUp $$ - $$ text $$ - $$ else $$ - $$ text $$ - $$ endif $$ - $$ endmacro $$ - $$ macro flatCard(href, title, description, linkText, imgClass) $$ - - $$title$$ -
-
$$ title $$
-
-

- $$ description $$ -

-
-
$$ linkText $$
-
-
- $$ endmacro $$ - $$ macro videoCard(url, title, src)$$ -
- - $$title$$ -
$$ title $$
-
-
- $$ endmacro $$ - $$ macro useCasesCard(subItems, title, imgClass, id) $$ -
- $$title$$ -
$$title$$
- -
- $$ endmacro $$ - $$ macro devToolsCard(link, title, description) $$ - -
$$ title $$
-

$$ description $$

-
- $$ endmacro $$ - $$ - set intermediateVideos = [ - {'{'} - "src": "./assets/img/backgrounds/docs-advanced-payment-features@2x.png", - "title": _("Advanced Payment Features"), - "url": "https://www.youtube.com/embed/e2Iwsk37LMk?rel=0&showinfo=0&autoplay=1", - {'}'}, - {'{'} - "src": "./assets/img/backgrounds/docs-governance@2x.png", - "title": _("Governance and the Amendment Process"), - "url": "https://www.youtube.com/embed/4GbRdanHoR4?rel=0&showinfo=0&autoplay=1", - {'}'}, - {'{'} - "src": "./assets/img/backgrounds/docs-sidechains@2x.png", - "title": _("Federated Sidechains"), - "url": "https://www.youtube.com/embed/NhH4LM8NxgY?rel=0&showinfo=0&autoplay=1", - {'}'}, - ] - $$ - $$ - set getStartedVideos = [ - {'{'} - "src": "./assets/img/backgrounds/docs-intro-to-XRP-ledger@2x.png", - "title": _("Intro to XRP Ledger"), - "url": "https://www.youtube.com/embed/sVTybJ3cNyo?rel=0&showinfo=0&autoplay=1", - {'}'}, - {'{'} - "src": "./assets/img/backgrounds/docs-accounts@2x.png", - "title": _("Accounts"), - "url": "https://www.youtube.com/embed/eO8jE6PftX8?rel=0&showinfo=0&autoplay=1", - {'}'}, - {'{'} - "src": "./assets/img/backgrounds/docs-decentralized-exchange@2x.png", - "title": _("Decentralized Exchange"), - "url": "https://www.youtube.com/embed/VWNrHBDfXvA?rel=0&showinfo=0&autoplay=1", - {'}'}, - {'{'} - "src": "./assets/img/backgrounds/docs-tokenization@2x.png", - "title": _("Tokenization"), - "url": "https://www.youtube.com/embed/Oj4cWOiWf4A?rel=0&showinfo=0&autoplay=1", - {'}'}, - ] - $$ - $$ - set devTools = [ - {'{'} - "title": _("Faucets"), - "link": "./xrp-testnet-faucet.html", - "description": - _("Get credentials and test-XRP for XRP Ledger Testnet or Devnet."), - {'}'}, - {'{'} - "title": _("WebSocket Tool"), - "link": "./websocket-api-tool.html", - "description": - _("Send sample requests and get responses from the rippled API."), - {'}'}, - {'{'} - "title": _("XRP Ledger Explorer"), - "link": "https://livenet.xrpl.org", - "description": - _("View validations of new ledger versions in real-time, chart the location of servers in the XRP Ledger."), - {'}'}, - {'{'} - "title": _("Transaction Sender"), - "link": "./tx-sender.html", - "description": - _("Test how your code handles various XRP Ledger transactions by sending them over the Testnet to the address."), - {'}'}, - ] - $$ -
-
+
+
+ +
+
- $$ flatCard("./concepts.html", - _("Concepts"), - _("Learn the \"what\" and the \"why\" behind fundamental aspects of the XRP Ledger."), - _("Read the Docs"), - "concepts-doc-illustration") $$ +
- $$ flatCard("./tutorials.html", - _("Tutorials"), - _("Get step-by-step guidance to perform common tasks with the XRP Ledger."), - _("View Tutorials"), - "tutorial-illustration") $$ +
- $$ flatCard("./references.html", - _("References"), - _("Look up reference documentation for the XRP Ledger protocol, API methods, and more."), - _("View References"), - "ref-book-illustration") $$ +
-
-
-
-

{translate("Use Cases")}

-
- { useCases.map(useCase => ( - $$ useCasesCard(useCase.subItems, useCase.title, useCase.imgClass, useCase.id)$$ - )) } -
-
-
-

{translate("Getting Started")}

-
+
+
+
+

{translate('Use Cases')}

+
+ {useCases.map(useCase => ( + + ))} +
+
+
+

{translate('Getting Started')}

+
-
-
- { getStartedVideos.map(video => ( - $$ videoCard(video.url, video.title, video.src) $$ - )) } -
-
- $$ primaryButton("https://www.youtube.com/playlist?list=PLJQ55Tj1hIVZtJ_JdTvSum2qMTsedWkNi", _("Watch Full Series"), true) $$ + +
{translate('Quickstart to XRP Ledger')}
+

{translate('An introduction to fundamental aspects of the XRP Ledger.')}

+
+
{translate('Get Started')}
+ quick-start +
-
-
-
-
-

{translate("Interact with the XRP Ledger in a language of your choice")}

-
{translate("Explore SDKs")}
-
-
-
- - - +
+ {getStartedVideos.map(video => ( + + ))} +
+
+ +
+
+
+
+
+
+

{translate('Interact with the XRP Ledger in a language of your choice')}

+
{translate('Explore SDKs')}
+
+ -
-
-

{translate("Intermediate Learning Sources")}

-
- { intermediateVideos.map(video => ( - $$ videoCard(video.url, video.title, video.src) $$ - )) } -
-
-
-
+
+
+
+

{translate('Intermediate Learning Sources')}

+
+ {intermediateVideos.map(video => ( + + ))} +
+
+
+
- +
-
-

{translate("Explore, Test, Verify")}

-
{translate("Explore Dev Tools")}
-
-

- {translate("Use these web-based tools to assist during all stages of development, from getting your first payment to testing your implementation for best practices.")} -

-
- { devTools.map(card => ( - $$ devToolsCard(card.link, card.title, card.description) $$ - )) } -
- $$ primaryButton("./dev-tools.html", "View All tools", false) $$ +
+

{translate('Explore, Test, Verify')}

+
{translate('Explore Dev Tools')}
+
+

+ {translate( + 'Use these web-based tools to assist during all stages of development, from getting your first payment to testing your implementation for best practices.' + )} +

+
+ {devTools.map(card => ( + + ))} +
+
-
-
-
-
+
+
+
+
{/*/#popular-topics*/} -
-
- - -
-

{translate("Get Free Test XRP")}

-

{translate("Connect to the XRP Ledger Testnet network to develop and test your apps built on the XRP Ledger, without risking real money or impacting production XRP Ledger users.")}

- {translate("Generate Testnet Credentials")} -
-
+

{translate('Browse By Recommended Pages')}

+
-
-
{/* Browse by recommended and Generate Testnet Credentials */} -
- {translate("See full documentation index")} -
-
- +
+
+ + +
+

{translate('Get Free Test XRP')}

+

+ {translate( + 'Connect to the XRP Ledger Testnet network to develop and test your apps built on the XRP Ledger, without risking real money or impacting production XRP Ledger users.' + )} +

+ + {translate('Generate Testnet Credentials')} + +
+
+
+
+ +
+ + {translate('See full documentation index')} + +
+
- ) + ); } diff --git a/content/top-nav.yaml b/content/top-nav.yaml index f27b9ed0e0..69f53080bb 100644 --- a/content/top-nav.yaml +++ b/content/top-nav.yaml @@ -10,58 +10,58 @@ - group: XRP Ledger Overview items: - label: XRPL Overview - link: /about/xrp-ledger-overview/ + href: /about/xrp-ledger-overview/ - label: Use Cases - link: /about/use-cases/ + href: /about/use-cases/ - label: History - link: /about/history/ + href: /about/history/ - label: Ledger Explorer - link: https://livenet.xrpl.org + href: https://livenet.xrpl.org external: true - group: XRP items: - label: XRP Overview - link: /about/xrp-overview + href: /about/xrp-overview - group: Sustainability items: - label: Impact - link: /about/impact/ + href: /about/impact/ - group: About items: - label: XRPL Foundation - link: https://foundation.xrpl.org/ + href: https://foundation.xrpl.org/ external: true - label: FAQ - link: /about/faq/ + href: /about/faq/ - group: Docs items: - hero: top-nav-hero-docs label: Documentation description: Dive into XRP Ledger technology and start integrating. - link: /docs/ + page: ./docs.page.tsx - group: Introduction to the XRP Ledger items: - label: What is XRP? - link: /docs/concepts/introduction/what-is-xrp + href: /docs/concepts/introduction/what-is-xrp - label: What is the XRP Ledger? - link: /docs/concepts/introduction/what-is-xrpl + href: /docs/concepts/introduction/what-is-xrpl - label: Transactions and Requests - link: /docs/concepts/introduction/txn-and-requests + href: /docs/concepts/introduction/txn-and-requests - group: Tutorials items: - label: Quickstart - link: /docs/tutorials/quickstart + href: /docs/tutorials/quickstart - label: Code Samples - link: /docs/code-samples + href: /docs/code-samples - group: API Reference items: - label: Client Libraries - link: /docs/references/client-libraries/ + href: /docs/references/client-libraries/ - label: Public API Methods - link: /docs/references/http-websocket-apis/public-api-methods/ + href: /docs/references/http-websocket-apis/public-api-methods/ - label: Admin API Methods - link: /docs/references/http-websocket-apis/admin-api-methods/ + href: /docs/references/http-websocket-apis/admin-api-methods/ - group: Popular Pages items: - label: Send XRP @@ -71,7 +71,7 @@ - label: XRPL Servers href: /infrastructure/xrpl-servers/ - label: Dev Tools - link: /docs/dev-tools/ + href: /docs/dev-tools/ - group: Community @@ -79,18 +79,18 @@ - hero: top-nav-hero-contribute label: Contribute to the XRPL Community description: Join the conversation - link: /community/ + href: /community/ - label: Events - link: /community/events/ + href: /community/events/ - label: Ambassadors - link: /community/ambassadors/ + href: /community/ambassadors/ - label: XRPL Jobs - link: https://jobs.xrpl.org/ + href: https://jobs.xrpl.org/ external: true - label: Blog - link: /blog/ + href: /blog/ - label: XRPL Grants - link: https://xrplgrants.org/ + href: https://xrplgrants.org/ external: true - label: Report a Scam - link: /community/report-a-scam/ + href: /community/report-a-scam/