Skip to content

Commit f66659d

Browse files
chore: format MD table for easier review
1 parent d0bb0dc commit f66659d

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

docs/guides/js-waku/waku-forum-opchan.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,21 @@ import { useForum } from '@opchan/react';
120120
const { user, content, permissions, network } = useForum();
121121
```
122122

123-
For bespoke logic, drop down to the individual hooks:
124-
125-
| Hook | Purpose | Typical actions |
126-
| --- | --- | --- |
127-
| `useAuth()` | Manage sessions, ENS verification, call signs, and delegation | `connect()`, `startAnonymous()`, `delegate('7days')`, `updateProfile()` |
128-
| `useContent()` | Read/write cells, posts, comments, votes, bookmarks | `createPost()`, `vote()`, `moderate.post()`, `pending.isPending(id)` |
129-
| `usePermissions()` | Query derived capabilities and friendly denial reasons | `canCreateCell`, `canModerate(cellId)`, `check('canPost')` |
130-
| `useNetwork()` | Reflect Waku connection status and hydration lifecycle | `isConnected`, `statusMessage`, `refresh()` |
131-
| `useUserDisplay(address)` | Resolve ENS + call-sign metadata for any address | `displayName`, `ensAvatar`, `verificationStatus` |
132-
| `useUIState(key, defaultValue, category?)` | Persist UI state to IndexedDB | `[value, setValue]` pair scoped by key |
133-
| `useEthereumWallet()` / `useClient()` | Advanced access to Wagmi connectors or the raw `OpChanClient` | `signMessage()`, direct database interactions |
123+
### Advanced: Fine-Grained Hook Reference
124+
125+
For more customized or advanced needs, you can work directly with the individual hooks that power OpChan.
126+
127+
| **Hook** | **Purpose** | **Common Methods/Values** |
128+
|-----------------------------------|-------------------------------------------------------------------------|------------------------------------------------------------|
129+
| `useAuth()` | User authentication, call signs, session & identity management | `connect()`, `startAnonymous()`, `delegate('7days')`, `updateProfile()` |
130+
| `useContent()` | Read and write data: cells, posts, comments, votes, bookmarks | `createPost()`, `vote()`, `moderate.post()`, `pending.isPending(id)` |
131+
| `usePermissions()` | Check what the user can or can't do, with detailed reasons | `canCreateCell`, `canModerate(cellId)`, `check('canPost')` |
132+
| `useNetwork()` | Network state, Waku connectivity, and hydration cycle | `isConnected`, `statusMessage`, `refresh()` |
133+
| `useUserDisplay(address)` | Get ENS & call-sign profile info about any Ethereum address | `displayName`, `ensAvatar`, `verificationStatus` |
134+
| `useUIState(key, defaultValue, category?)` | Persist UI/user state in IndexedDB | `[value, setValue]` (React state pair) |
135+
| `useEthereumWallet()`<br/>`useClient()` | Power-user hooks for direct access to Wagmi or the OpChanClient | `signMessage()`, direct client/database calls |
136+
137+
_Note: These hooks can be combined with the high-level `useForum()` API or used independently where your app structure requires._
134138

135139
### Sample snippets
136140

0 commit comments

Comments
 (0)