import { Link } from 'react-router-dom' import { Avatar, Divider, Input, Button } from 'antd' import user from '../../materials/user.png' import { connect } from 'react-redux' import { Row, Col } from 'antd' import { CCommentsOnePost } from '../../components/comment/Comment' import { CPostEditor } from '../createAndEditPost' import AddComment from '../../components/comment/AddComment' import { actionFullOnePostSaga, actionAddFullCommentSaga, } from '../../actions/typeSaga/postTypesSaga' import { CLike } from '../../components/like/Like' import { ConstructorModal } from '../../helpers' import React, { useState, useEffect } from 'react' import { LinkToUser } from '../../components/LinkToUser' import { MyCarousel } from '../../components/post/Carousel' import { EditMyPostButton } from '../../components/buttons/EditPostButton' export const PagePost = ({ my_Id, onePost, addComment, match: { params: { _id }, }, onPost, }) => { const [isModalVisible, setIsModalVisible] = useState(false) useEffect(() => { onPost(_id) }, [_id]) return ( <>

Created Post:{' '} {new Intl.DateTimeFormat('en-GB').format(onePost?.createdAt)}

{/* */} {my_Id === onePost?.owner?._id && ( )} {/* */}

Title: {onePost?.title || ''}

Text: {onePost?.text || ''}

Comments
{/*
*/} {/* */} {/* */} {/*
*/}
) } export const CPost = connect( (state) => ({ onePost: state?.post.onePost, my_Id: state.auth.payload?.sub?.id || '', aboutUser: state.userData?.aboutUser, }), { addComment: actionAddFullCommentSaga, onPost: actionFullOnePostSaga, }, )(PagePost)