react-simple-comment

Example View

notion image

Installation


NPM
$ npm i react-simple-comment

Usage

import {BasicComment,BaseReply, replyInterface} from 'react-simple-comment' function App() { const [data] = React.useState([{ id : 1, name : 'jun', text : 'test', date : new Date(), likeCount : 0, dislikeCount : 2 }, { id : 2, name : 'jun', text : 'test', date : new Date(), likeCount : 10 }] as replyInterface[]) return ( <div> <span>๋Œ“๊ธ€ {data.length}๊ฐœ</span> <BasicComment placeholder="๋Œ“๊ธ€์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”..." onSend={(text)=>{ console.log('current text',text) }} /> <div> {data.map((data) => <BaseReply onLike={(commentId)=>{ console.log('onLike',commentId) }} onDislike={(commentId)=>{ console.log('onDisLike',commentId) }} onReplySend={(commentId,text)=>{ console.log('onReplySend',commentId,text) }} {...data} /> ) } </div> </div> ); } export default App;
ย 

Props


โ€ฆ

๋™๊ธฐ

nextjs๋กœ notion๋ธ”๋กœ๊ทธํ™” ์ง„ํ–‰์ค‘ ๋Œ“๊ธ€๊ธฐ๋Šฅ์ด ํ•„์š”ํ•œ๋ฐ ๊ฐ„๋‹จํ•œ ๋Œ“๊ธ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์—†์—ˆ๊ณ  ํ•˜๋‚˜ ๋งŒ๋“ค์–ด๋‘๋ฉด ๋‹ค์Œ ์ง„ํ–‰ ํ”„๋กœ์ ํŠธ์—๋„ ์žฌ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•  ๊ฒƒ ๊ฐ™๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ์‹œ์ž‘ํ•œ๋‹ค

๊ธฐ๋Šฅ

v1.0.1

  • ๋Œ“๊ธ€์ž…๋ ฅ ๊ธฐ๋Šฅ
  • ์ „์†ก ๊ธฐ๋Šฅ

to be added

  1. ๋Œ“๊ธ€์ •๋ ฌ ๊ธฐ๋Šฅ
  1. ๋Œ“๊ธ€๊ฒ€์ƒ‰ ๊ธฐ๋Šฅ
ย 

๊ฐœ๋ฐœํ™˜๊ฒฝ

  • nodejs 19.0.3
    ๋Œ“๊ธ€ 0๊ฐœ

    ๋“ฑ๋ก๋œ ๋Œ“๊ธ€์ด ํ•˜๋‚˜๋„ ์—†์Šต๋‹ˆ๋‹ค...๐Ÿ˜ข