-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathAdvancedComponent.tsx
More file actions
71 lines (65 loc) · 2.29 KB
/
AdvancedComponent.tsx
File metadata and controls
71 lines (65 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import React, { useEffect } from 'react'
import { CommentSection } from 'react-comments-section'
import 'react-comments-section/dist/index.css'
import { useState } from 'react'
import moment from 'moment'
const AdvancedComponent = () => {
const [updatedDate, setUpdatedDate] = useState("");
const [data] = useState([]);
useEffect(() =>
{
setInterval(function () {
setUpdatedDate(moment().format("YYYY-MM-DD, HH:mm:ss"));
}, 1000);
}, [updatedDate]);
return (
<div style={{ width: '100%' }}>
<a
style={{ color: 'black', cursor: 'pointer' }}
target='_blank'
rel='noopener noreferrer'
href='https://github.com/RiyaNegi/react-comments-section/blob/main/example/src/components/AdvancedComponent.tsx'
>
<span className='title'>Advanced Input Component</span>
</a>
<CommentSection
currentUser={{
currentUserId: '01a',
currentUserImg:
'https://ui-avatars.com/api/name=Riya&background=random',
currentUserProfile:
'https://www.linkedin.com/in/riya-negi-8879631a9/',
currentUserFullName: 'Riya Negi',
currentUserCreatedAt: moment().format("YYYY-MM-DD HH:mm:ss"),
currentUserUpdatedAt: updatedDate
}}
hrStyle={{ border: '0.5px solid #ff0072' }}
commentData={data}
currentData={(data: any) => {
console.log('curent data', data)
}}
logIn={{
loginLink: 'http://localhost:3001/',
signupLink: 'http://localhost:3001/'
}}
customImg='https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fstatic.onecms.io%2Fwp-content%2Fuploads%2Fsites%2F13%2F2015%2F04%2F05%2Ffeatured.jpg&q=60'
inputStyle={{ border: '1px solid rgb(208 208 208)' }}
formStyle={{ backgroundColor: 'white' }}
submitBtnStyle={{
border: '1px solid black',
backgroundColor: 'black',
padding: '7px 15px'
}}
cancelBtnStyle={{
border: '1px solid gray',
backgroundColor: 'gray',
color: 'white',
padding: '7px 15px'
}}
advancedInput={true}
replyInputStyle={{ borderBottom: '1px solid black', color: 'black' }}
/>
</div>
)
}
export default AdvancedComponent