discus-lib
Advanced tools
Comparing version 1.0.8 to 1.0.9
{ | ||
"name": "discus-lib", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
# discus-lib | ||
This package is a user discussion components where the user can comment on a post and discuss on that. | ||
## Overview | ||
**discus-lib** is a React component library built with TypeScript. It provides components for a `Comment box` where users can post comments and a `Comment thread` to display all the posted comments. | ||
**discus-lib** is a React component library built using TypeScript. It provides `Comment box` where users can post comments and a `Comment` to display all the posted comments. | ||
@@ -20,3 +22,3 @@ ## Installation | ||
The component can also take two properties: | ||
* `name`: "string" that holds the name of the user to be displayed. If the property is not mentioned it will display as __Unknown User__ | ||
* `name`: "string" that holds the name of the user to be displayed. If the property is not mentioned it will display as *__Unknown User__* | ||
* `setDiscussion`: "React state function" that hold the function to set the comments from the package and that can be manipulated in the actual component. | ||
@@ -30,11 +32,2 @@ | ||
type ReplyType = { | ||
id: string; | ||
userName: string; | ||
reply: string; | ||
timestamp: Date; | ||
likeCount: number; | ||
dislikeCount: number; | ||
}; | ||
type CommentType = { | ||
@@ -45,3 +38,3 @@ id: string; | ||
timestamp: Date; | ||
reply: ReplyType[]; | ||
reply: CommentType[]; | ||
likeCount: number; | ||
@@ -79,6 +72,6 @@ dislikeCount: number; | ||
The comments structure which is captured in the `setDiscussion` state function will be as an array[] of object and the sample object is shown as below. | ||
The comments schema which is captured in the `setDiscussion` state function will be as an array[] of object that is shown as below. | ||
``` | ||
[ | ||
CommentType = [ | ||
{ | ||
@@ -93,3 +86,3 @@ id: string; | ||
userName: string; | ||
reply: string; | ||
reply: CommentType[]; | ||
timestamp: Date; | ||
@@ -106,4 +99,8 @@ likeCount: number; | ||
### Note | ||
*__Discus__* component is a recursion based component where the *__Comment__* component will recursively call the *__CommentBox__* component for replying on that comment. | ||
## License | ||
This project is licensed under the *MIT License*. See the [LICENSE](https://docs.npmjs.com/policies/npm-license) file for details. | ||
This project is licensed under the *__MIT License__*. See the [LICENSE](https://docs.npmjs.com/policies/npm-license) file for details. |
40475
101