Skip to content

Commit

Permalink
stack app docs use new format
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 committed Nov 10, 2024
1 parent 914be38 commit 15db377
Show file tree
Hide file tree
Showing 9 changed files with 617 additions and 366 deletions.
19 changes: 15 additions & 4 deletions docs/fern/custom-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,30 @@ function replaceStackLinkTo() {
}
}

function keepReplacingStackLinkTo() {
function replaceEmptyTabs() {
const tabs = document.querySelectorAll(`.small-codeblock-tabs button:not(.stack-replaced-empty-tab)`);
for (const tab of tabs) {
tab.classList.add(`stack-replaced-empty-tab`);
if (tab.textContent.trim() === "<<empty>>") {
tab.remove();
}
}
}

function runRenderActions() {
try {
replaceStackLinkTo();
requestAnimationFrame(keepReplacingStackLinkTo);
replaceEmptyTabs();
requestAnimationFrame(runRenderActions);
} catch (e) {
console.error(e);
alert(`Error during custom script while replacing stack-link-to. This message will only be shown on localhost.\n\n${e} ${e.message} ${e.stack}`);
alert(`Error during custom script while running render actions. This message will only be shown on localhost.\n\n${e} ${e.message} ${e.stack}`);
}
}

async function main() {
initPostHog();
keepReplacingStackLinkTo();
runRenderActions();
}

main().catch((e) => {
Expand Down
1 change: 1 addition & 0 deletions docs/fern/docs/pages/sdk/hooks/use-user.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: useUser
slug: /sdk/hooks/use-user
---

A React hook that fetches and manages user data.
Expand Down
Loading

0 comments on commit 15db377

Please sign in to comment.