Skip to content

add React docs section (@cofhe/react) and replace quick-start stub#28

Draft
roeezolantz wants to merge 1 commit into
masterfrom
docs/react-section
Draft

add React docs section (@cofhe/react) and replace quick-start stub#28
roeezolantz wants to merge 1 commit into
masterfrom
docs/react-section

Conversation

@roeezolantz
Copy link
Copy Markdown
Contributor

Summary

@cofhe/react is a fully-shipped library (currently 0.5.2) with providers, hooks for connection / permits / encryption / decryption / contract reads & writes / token helpers, and a styled UI kit including the CofheFloatingButton portal. The docs had only one page about it — a stub quick-start saying it was "currently in development." This PR replaces the stub and adds a real three-page React section.

Together this covers gaps B-1 and A-5 from the docs audit on XDL-11.

Where the underlying changes were made

All shipped in @cofhe/react@0.5.0, with two patches since:

Source layout (every reference is from packages/react/src/):

Changes

File What changed
client-sdk/react/getting-started.mdx New. Install + peer deps (with the MUI removal note), CofheProvider props table (config-only vs pass-an-existing-client modes), the react.* config options table (projectName, logger, position, initialTheme), hooks-only vs @cofhe/react/ui styled-UI entrypoints, SSR notes.
client-sdk/react/hooks.mdx New. Hook reference grouped into: Client and connection, Coprocessor status (useCofheEnabled), Permits (typed ValidationResult.error), Encryption (useCofheEncrypt, useEncryptInput), Reading encrypted state (with the disabledDueToMissingValidPermit rename <Note>), Writing encrypted state, and the full CoFHE token-helper surface. Cross-references the TaskManager and Permits deep-dives.
client-sdk/react/components-and-portal.mdx New. CofheEncryptInput props table, the CofheFloatingButton portal mount snippet, wallet-disconnected projectName behavior, position/theme config, the custom-token import flow, bundling notes (CSS auto-load on /ui, MUI peer removed).
client-sdk/quick-start/react.mdx Replaced the stub. Real install + provider + decrypted-balance walkthrough, with links into the new React section.
docs.json Added the "React" group under the Client SDK tab, between "Foundry Plugin" and "Examples", with the three new page IDs.

Test plan

  • `mint dev` shows a new "React" group in the Client SDK sidebar with three reachable pages.
  • The replaced React quick-start no longer says "in development" and instead links into /client-sdk/react/*.
  • Cross-references to existing pages resolve:
    • /client-sdk/guides/permits#validating-permits
    • /deep-dive/cofhe-components/task-manager#enable--disable-switch
    • /client-sdk/react/getting-started#react-config-options

@cofhe/react 0.5.2 ships providers, hooks, an SSR-safe SDK boundary, a
styled UI kit, and a token portal. The docs had only a stub
quick-start page saying the library was 'currently in development'.

- New nav group 'React' under the Client SDK tab with three pages:
  - getting-started: install, CofheProvider, hooks-only vs styled UI
    entrypoints, react.* config (projectName, logger, position, theme),
    SSR notes.
  - hooks: client/connection (useCofheClient, useCofheConnection,
    useCofheConnect, useCofheAutoConnect), coprocessor status
    (useCofheEnabled), permits (useCofheActivePermit and the typed
    ValidationResult.error union), encryption (useCofheEncrypt,
    useEncryptInput), reads (useCofheReadContract,
    useCofheReadContractAndDecrypt) with the renamed
    disabledDueToMissingValidPermit flag called out, writes
    (useCofheWriteContract), and the full CoFHE token-helper surface.
  - components-and-portal: CofheEncryptInput props,
    CofheFloatingButton portal, wallet-disconnected projectName
    behavior, custom-token import flow.
- Replace the quick-start/react.mdx stub with a real walkthrough that
  links into the new section.
- docs.json: add the 'React' group between Foundry Plugin and
  Examples.

Co-authored-by: multica-agent <github@multica.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant