Skip to content

Commit a6f401a

Browse files
fixed compose btns and added styled more to go
1 parent 2d7e1f8 commit a6f401a

File tree

8 files changed

+114
-276
lines changed

8 files changed

+114
-276
lines changed

client/.flowconfig

Lines changed: 0 additions & 4 deletions
This file was deleted.

client/src/App.css

Lines changed: 30 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/App.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/components/layout components/Post/Post.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ import {
88
} from "../../../actions/getPostAction";
99
import { showNav } from "../../../actions/navAction";
1010
import PostHolder from "./Post-Placeholder/PostHolder";
11-
import { getEstimatedTime } from "../../../utils/estimateTime";
1211
import { ParsedData } from "draftjs-raw-parser";
1312
import { getThatProfileE } from "../../../actions/profileAction";
1413
import { reallyGetAllPosts } from "../../../actions/getPostAction";
15-
import CommentInput from "../../comment/CommentInput";
1614
import { postComment } from "../../../actions/commentAction";
17-
import CommentItem from "../../comment/CommentItem";
1815
import Comment from "../../comment/Comment";
1916

2017
const Post = ({
@@ -27,8 +24,6 @@ const Post = ({
2724
history,
2825
getThatProfileE,
2926
reallyGetAllPosts,
30-
postComment,
31-
comment: { commenting },
3227
setCurrentPost,
3328
}) => {
3429
const [lik, setLik] = useState([]);
@@ -122,7 +117,7 @@ const Post = ({
122117
<span>No id</span>
123118
)}
124119
<div className="dot-i"></div>
125-
<span>{post.content && getEstimatedTime(post.content)}</span>
120+
<span>{"7min"}</span>
126121
<i
127122
onClick={likeThisPost}
128123
className={`fa${likedBtn() ? "s" : "r"} fa-heart`}
@@ -140,26 +135,6 @@ const Post = ({
140135
<div class="post-comment-seperator"></div>
141136
<div className="comment-tag">Comments</div>
142137
<Comment auth={auth} post_id={currentPost} />
143-
{/* {auth.isAuthenticated && (
144-
<CommentInput
145-
addComment={postComment}
146-
user_id={auth.user._id}
147-
post_id={openedPost._id}
148-
status={commenting}
149-
/>
150-
)}
151-
<div>All Comment</div>
152-
{openedPost.comment && (
153-
<div>
154-
{openedPost.comment.map((cmt) => (
155-
<CommentItem
156-
username={cmt.nameOfUser}
157-
src={cmt.imgOfUser}
158-
comment_msg={cmt.comment_msg}
159-
/>
160-
))}
161-
</div>
162-
)} */}
163138
</div>
164139
</React.Fragment>
165140
);

client/src/components/layout components/editor/Edt.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

client/src/components/layout components/editor/PostEditor.js

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import React from "react";
2-
import parseJSON from "../../../utils/parseJSON";
1+
import React, { useState, useEffect } from "react";
32
import { connect } from "react-redux";
43
import {
54
uploadPost,
65
uploadImage,
76
clearPostID,
87
} from "../../../actions/getPostAction";
9-
import {
10-
ContentState,
11-
convertToRaw,
12-
Editor,
13-
EditorState,
14-
RichUtils,
15-
} from "draft-js";
8+
import { convertToRaw, Editor, EditorState, RichUtils } from "draft-js";
169

1710
const PostEditor = ({
1811
uploadPost,
@@ -22,14 +15,13 @@ const PostEditor = ({
2215
uploadImage,
2316
clearPostID,
2417
}) => {
25-
const instanceRef = React.useRef(null);
26-
const [heading, setHeading] = React.useState("");
27-
const [upload, setUpload] = React.useState("");
28-
const [editorState, setEditorState] = React.useState(() =>
18+
const [heading, setHeading] = useState("");
19+
const [upload, setUpload] = useState("");
20+
const [editorState, setEditorState] = useState(() =>
2921
EditorState.createEmpty()
3022
);
3123

32-
React.useEffect(() => {
24+
useEffect(() => {
3325
setUpload("");
3426
if (post.imageUploaded) {
3527
setUpload("Uploaded!");
@@ -83,13 +75,17 @@ const PostEditor = ({
8375

8476
return (
8577
<div className="d-flex flex-column editor-container-compose">
86-
<input
87-
type="file"
88-
name="file"
89-
id="file"
90-
className="custom-file-input"
91-
onChange={addFile}
92-
/>
78+
<div className="img-upload">
79+
<input
80+
type="file"
81+
name="file"
82+
id="file"
83+
className="custom-file-input"
84+
onChange={addFile}
85+
/>
86+
<div className="custom-upload post-post-btn">Upload Image</div>
87+
{/* <div cla></div> */}
88+
</div>
9389
<span style={uploadingStyles}>{upload}</span>
9490
<div className="d-flex justify-content-center compose-heading">
9591
<input
@@ -105,14 +101,9 @@ const PostEditor = ({
105101
editorState={editorState}
106102
onChange={setEditorState}
107103
handleKeyCommand={handleKeyCommand}
104+
className="the-main-editor"
108105
/>
109-
<button className="" onClick={handleSave}>
110-
{post.uploadedStatus && (
111-
<span
112-
className="spinner-border spinner-border-sm"
113-
aria-hidden="true"
114-
></span>
115-
)}
106+
<button className="post-post-btn" onClick={handleSave}>
116107
<span>{post.uploadedStatus ? "" : "Post"}</span>
117108
</button>
118109
</div>

0 commit comments

Comments
 (0)