|
15 | 15 | The Comments plugin is built using a standard implementation of [Open Threads](https://docs.3box.io/build/web-apps/messaging/choose#open-threads) which are defined in the [3Box Threads API](https://docs.3box.io/api/messaging) and made available via the [`3Box.js SDK`](https://github.com/3box/3box-js). The Comments plugin also includes UI for inputting and displaying user comments, logic for fetching user profiles, and pagination. The component is configurable to various authentication patterns, and can handle both Web3/3Box logged-in & logged-out states.
|
16 | 16 |
|
17 | 17 | #### Authentication
|
18 |
| -Without authenticating, users can read messages in the comment thread. However authentication is required to perform more interactive functionality. After the user is authenticated, a user can post a comment, delete their comment, and receive comments from other users in *real-time*. Note: if you are not logged in and the component has not been passed your ethereum address, the component cannot know which comment belongs to you in order to delete. The ability to sign in without leaving a comment so that you can delete will be implemented soon. |
| 18 | +Without authenticating, users can read messages in the comment thread. However authentication is required to perform more interactive functionality. After the user is authenticated, a user can post a comment, delete their comment, and receive comments from other users in *real-time*. Note: if you are not logged in and the component has not been passed your ethereum address, the component cannot know which comment belongs to you in order to delete. In this case, click the login button just below the input UI. |
19 | 19 | </br>
|
20 | 20 | </br>
|
21 | 21 |
|
@@ -125,7 +125,7 @@ const MyComponent = ({ handleLogin, box, ethereum, myAddress, currentUser3BoxPro
|
125 | 125 | | `threadName` | String | | Always | A name specific to this Comments thread. |
|
126 | 126 | | `adminEthAddr` | String (Ethereum Address) | | Always | The Ethereum address you wish to give admin rights to for the Comments thread. This user will be able to delete all comments and accept members in a members-only thread. **A thread with a new admin address, despite identical `spaceName` and `threadName`, will create an entirely new thread.**|
|
127 | 127 | | `box` | Object | | A (and likely B) | The `box` instance returned from running `await Box.openBox(address, web3)` somewhere in your dApp.|
|
128 |
| -| `currentUserAddr` | String (Ethereum Address) | | A & B | The current user's Ethereum address. Passing this will help determine whether a user has delete access on each comment. This prop will also let the component fetch that user's 3Box profile on component mount and render that data (profile picture) in the Comment input UI. | |
| 128 | +| `currentUserAddr` | String (Ethereum Address) | | A & B, optional for C | The current user's Ethereum address. Passing this will help determine whether a user has delete access on each comment. This prop will also let the component fetch that user's 3Box profile on component mount and render that data (profile picture) in the Comment input UI. | |
129 | 129 | | `loginFunction` | Function | | B | A function from your dApp that handles web3 and 3Box login at the global dApp state. This callback will run when a user attempts to save a comment but a `box` instance doesn't yet exist. Running this function should result in a box instance (from `const box = Box.openBox(address, web3)`) being passed as the `box` prop to this component. |
|
130 | 130 | | `ethereum` | Object | window.ethereum | C | The `ethereum` object from whichever web3 provider your dApp uses. The `enable` method on this object will be used to get the current user's Ethereum address and that address will be used to `openBox` within the current Component context.|
|
131 | 131 | | `members` | Boolean | False | Optional | A boolean - `true` - to make the thread a members-only thread. Passing `false` will allow all users to post to the thread. **Changing this setting after creating it will result in an entirely different thread** (see [Docs.3box.io](https://Docs.3box.io) for more info). |
|
|
0 commit comments