|
@@ -0,0 +1,44 @@
|
|
|
+import { connect } from "react-redux";
|
|
|
+import { backendURL } from "../../actions";
|
|
|
+
|
|
|
+
|
|
|
+const PostItem = ({findPost}) =>{
|
|
|
+ return(
|
|
|
+ <div className="rounded-md shadow-md p-3 sm:w-96">
|
|
|
+ <div className="flex items-center justify-between p-3">
|
|
|
+ <div className="flex items-center space-x-2">
|
|
|
+ <img src={findPost.owner?.avatar?.url ? `${backendURL}/${findPost.owner?.avatar?.url}`:""} alt="userAvatar" className="object-cover object-center w-14 h-14 rounded-full shadow-sm bg-slate-600 "/>
|
|
|
+ <div className="-space-y-1">
|
|
|
+ <h2 className="text-sm font-semibold leading-none">{findPost.owner.nick}</h2>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <img className="object-cover object-center w-full h-72 bg-slate-500"/>
|
|
|
+ <div className="p-3">
|
|
|
+ <div className="flex items-center justify-between">
|
|
|
+ <div className="flex items-center space-x-3">
|
|
|
+ <button className="flex items-center justify-center">Like</button>
|
|
|
+ <button className="flex items-center justify-center">Comment</button>
|
|
|
+ <button className="flex items-center justify-center">Direct</button>
|
|
|
+ </div>
|
|
|
+ <button className="flex items-center justify-center">Save to collection</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="space-y-3">
|
|
|
+ <p className="text-sm">
|
|
|
+ <span className="text-base font-semibold pr-2">{findPost.owner.nick}</span>
|
|
|
+ {findPost.title} {findPost.text}
|
|
|
+ </p>
|
|
|
+ <input type="text" placeholder="Add a comment" className="w-full py-0.5 bg-transparent border-none rounded text-sm pl-0 text-gray-400"/>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+const CPostItem = connect(state=>({findPost: state.promise?.findPost?.payload || {}}))(PostItem)
|
|
|
+
|
|
|
+
|
|
|
+export default CPostItem;
|