|
@@ -1,7 +1,7 @@
|
|
import user from '../materials/user.png'
|
|
import user from '../materials/user.png'
|
|
import { Link } from 'react-router-dom'
|
|
import { Link } from 'react-router-dom'
|
|
import { Avatar, Col, Row } from 'antd'
|
|
import { Avatar, Col, Row } from 'antd'
|
|
-
|
|
|
|
|
|
+import { CSubscribeLinkUser } from '../components/Subscribe'
|
|
export const LinkToUser = ({
|
|
export const LinkToUser = ({
|
|
_id,
|
|
_id,
|
|
avatar,
|
|
avatar,
|
|
@@ -14,6 +14,51 @@ export const LinkToUser = ({
|
|
return (
|
|
return (
|
|
// <Row style={{ margin:'10px', marginBottom:'20px' }}>
|
|
// <Row style={{ margin:'10px', marginBottom:'20px' }}>
|
|
|
|
|
|
|
|
+ <Row style={{ margin:'10px', marginBottom:'20px' }}>
|
|
|
|
+ <Link
|
|
|
|
+ to={`/profile/${_id}`}
|
|
|
|
+ style={{
|
|
|
|
+ display: 'flex',
|
|
|
|
+ padding: padding,
|
|
|
|
+ flexDirection: 'row',
|
|
|
|
+ fontSize: font,
|
|
|
|
+ }}
|
|
|
|
+ onClick={onClick}
|
|
|
|
+ key={key}
|
|
|
|
+ >
|
|
|
|
+ <Col offset={1} className="gutter-row" >
|
|
|
|
+ {avatar ? (
|
|
|
|
+ <Avatar
|
|
|
|
+ size={size}
|
|
|
|
+ src={'/' + avatar?.url}
|
|
|
|
+ style={{ marginRight: '3px' }}
|
|
|
|
+ />
|
|
|
|
+ ) : (
|
|
|
|
+ <Avatar size={size} src={user} style={{ marginRight: '3px' }} />
|
|
|
|
+ )}
|
|
|
|
+ </Col>
|
|
|
|
+ <Col offset={2} style={{marginTop:'5px'}}>
|
|
|
|
+ <h3> {login || 'Anon'}</h3>
|
|
|
|
+ </Col>
|
|
|
|
+ {/* <Subscribe */}
|
|
|
|
+ </Link>
|
|
|
|
+
|
|
|
|
+ </Row>
|
|
|
|
+ )
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export const LinkWithSubscribe = ({
|
|
|
|
+ _id,
|
|
|
|
+ avatar,
|
|
|
|
+ login,
|
|
|
|
+ size,
|
|
|
|
+ font = '15px',
|
|
|
|
+ padding = '10px',
|
|
|
|
+ onClick, key,
|
|
|
|
+ myId
|
|
|
|
+}) => {
|
|
|
|
+ return (
|
|
<Row style={{ margin:'10px', marginBottom:'20px' }}>
|
|
<Row style={{ margin:'10px', marginBottom:'20px' }}>
|
|
<Link
|
|
<Link
|
|
to={`/profile/${_id}`}
|
|
to={`/profile/${_id}`}
|
|
@@ -41,6 +86,19 @@ export const LinkToUser = ({
|
|
<h3> {login || 'Anon'}</h3>
|
|
<h3> {login || 'Anon'}</h3>
|
|
</Col>
|
|
</Col>
|
|
</Link>
|
|
</Link>
|
|
|
|
+ {
|
|
|
|
+ console.log('my_id', myId)}
|
|
|
|
+
|
|
|
|
+ { myId == _id ?
|
|
|
|
+ console.log('DDDDDDDDDD') :
|
|
|
|
+ <div style={{
|
|
|
|
+ right: '0',
|
|
|
|
+ position: 'absolute', marginRight:'20px'}}>
|
|
|
|
+
|
|
|
|
+ <CSubscribeLinkUser followId={_id} />
|
|
|
|
+ </div>
|
|
|
|
+ }
|
|
|
|
+
|
|
</Row>
|
|
</Row>
|
|
)
|
|
)
|
|
}
|
|
}
|