Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump loader-utils from 2.0.3 to 2.0.4 in /client #35

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
109c992
refactoring
micahsuomi Mar 10, 2021
b7bece5
fixing urls
micahsuomi Mar 10, 2021
cd8945f
fixing urls
micahsuomi Mar 10, 2021
e44043b
fixing urls for axios
micahsuomi Mar 10, 2021
bd78348
fixing proxy urls
micahsuomi Mar 10, 2021
ffea1bf
testing proxy
micahsuomi Mar 10, 2021
ef31536
testing proxy
micahsuomi Mar 10, 2021
86ad4b8
refactoring
micahsuomi Mar 12, 2021
b07ff07
refactoring
micahsuomi Mar 12, 2021
e65b239
testing google-auth
micahsuomi Mar 12, 2021
e641ff4
fixing heroku bugs
micahsuomi Mar 12, 2021
18a57ce
switching branch
micahsuomi Mar 12, 2021
a78c62c
adding readme-info
micahsuomi Mar 12, 2021
6dd7a52
chore: update dependencies due to security issue
micahsuomi Apr 12, 2021
ec8d1ec
refactor: removed console.logs
micahsuomi Apr 13, 2021
2121375
Merge pull request #30 from micahsuomi/fix/refactor-code
micahsuomi Apr 13, 2021
467925e
chore: fixing conflics for merge develop
micahsuomi Apr 13, 2021
869a6d1
Merge branch 'develop' into update/update-json
micahsuomi Apr 13, 2021
877f26a
Merge pull request #31 from micahsuomi/update/update-json
micahsuomi Apr 13, 2021
cfc9c47
chores: adding commits
micahsuomi Apr 13, 2021
c24c9db
Merge pull request #32 from micahsuomi/update/update-json
micahsuomi Apr 13, 2021
c179aea
updated dependencies, tested build for switching deployment platform
micahsuomi Oct 18, 2022
ec88dcf
Bump debug and mailgun-js
dependabot[bot] Oct 18, 2022
d5a6ee8
Merge pull request #33 from micahsuomi/dependabot/npm_and_yarn/debug-…
micahsuomi Oct 18, 2022
d96d1d6
retesting deployment
micahsuomi Oct 20, 2022
3a50ee8
retesting deployment
micahsuomi Oct 21, 2022
4573c9e
removed console.logs()
micahsuomi Oct 21, 2022
98f98c2
Bump loader-utils from 2.0.3 to 2.0.4 in /client
dependabot[bot] Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
494 changes: 51 additions & 443 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
40,710 changes: 21,666 additions & 19,044 deletions client/package-lock.json

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@emoji-mart/data": "^1.0.6",
"@emoji-mart/react": "^1.0.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.21.1",
"emoji-mart": "^3.0.0",
"emoji-mart": "^5.2.2",
"moment": "^2.29.1",
"node-sass": "^7.0.3",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-facebook-login": "^4.1.1",
"react-google-login": "^5.2.2",
"react-js-pull-to-refresh": "^1.2.2",
"react-paginate": "^6.3.2",
"react-redux": "^7.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.3",
"react-scripts": "^5.0.1",
"react-validator": "^0.1.0",
"redux": "^4.0.5",
"redux-saga": "^1.1.3",
Expand All @@ -30,7 +32,7 @@
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000/",
"proxy": "http://localhost:5000",
"eslintConfig": {
"extends": "react-app"
},
Expand All @@ -46,4 +48,4 @@
"last 1 safari version"
]
}
}
}
2 changes: 1 addition & 1 deletion client/src/components/AddComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from "react";
import { useDispatch } from "react-redux";
import PropTypes from "prop-types";
import { Picker } from "emoji-mart";
import "emoji-mart/css/emoji-mart.css";
// import "emoji-mart/css/emoji-mart.css";

import { addComment, getComments } from "../../redux/actions/commentActions";

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/AddCommentReply/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from "react";
import { useDispatch } from "react-redux";
import PropTypes from "prop-types";
import { Picker } from "emoji-mart";
import "emoji-mart/css/emoji-mart.css";
// import "emoji-mart/css/emoji-mart.css";

import {
getComments,
Expand Down
18 changes: 7 additions & 11 deletions client/src/components/AddPhoto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const AddPhoto = ({ history }) => {
selectedFile: null,
});
const [mediumArr, setMediumArr] = useState([]);
const [isMediumDup, setIsMediumDup] = useState(false)
const [isMediumDup, setIsMediumDup] = useState(false);
const [warning, setWarning] = useState("");

useEffect(() => {
if (!isAuthenticated) {
history.push("/login");
history.push("/login");
}
}, [isAuthenticated, history]);

Expand Down Expand Up @@ -85,18 +85,16 @@ const AddPhoto = ({ history }) => {
const addToMedium = (e) => {
e.preventDefault();
const mediumIndex = mediumArr.indexOf(medium);
console.log(medium.length)
if (medium.length < 1) {
setWarning("Please enter a value");
} else
if (mediumIndex !== -1) {
} else if (mediumIndex !== -1) {
setWarning("Tag already present");
prompt('tag already present')
prompt("tag already present");
setIsMediumDup(true);
} else {
setMediumArr([...mediumArr, medium]);
setText({ ...text, medium: "" });
console.log(mediumArr);

setWarning("");
setIsMediumDup(false);
}
Expand Down Expand Up @@ -168,9 +166,7 @@ const AddPhoto = ({ history }) => {
type="text"
name="medium"
value={medium}
placeholder={
"eg(oil, acrylics, dripping, photography etc)"
}
placeholder={"eg(oil, acrylics, dripping, photography etc)"}
onChange={handleChange}
/>
<button
Expand All @@ -197,7 +193,7 @@ const AddPhoto = ({ history }) => {
))}
</div>
<span className="add-photo__medium-warning">{warning}</span>
{medium.length < 1 || medium !== '' || isMediumDup && warning}
{medium.length < 1 || medium !== "" || (isMediumDup && warning)}
</div>

<div className="add-photo__input-topics">
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/AddPhotoButton/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
.add-photo-link {
display: none;
}
}
}
2 changes: 1 addition & 1 deletion client/src/components/Comment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const Comment = ({
lockScrolling,
unlockScrolling,
}) => {

const dispatch = useDispatch();
const [isEditDeleteOpen, setIsEditDeleteOpen] = useState(false);
const [isEditing, setIsEditing] = useState(false);
Expand Down Expand Up @@ -198,7 +199,6 @@ const Comment = ({
</div>
{comment.likes !== undefined &&
users.map((user) => {
console.log('comment likes', comment.likes)
for (let i = 0; i < comment.likes.length; i++) {
const like = comment.likes[i];
if (user._id === like) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/CommentLike/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ CommentLike.propTypes = {
userId: PropTypes.string,
name: PropTypes.string,
avatar: PropTypes.string
};
};
1 change: 0 additions & 1 deletion client/src/components/CommentReply/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ const CommentReply = ({
</div>
{commentReply.likes !== undefined &&
users.map((user) => {
console.log(commentReply.likes)
for (let i = 0; i < commentReply.likes.length; i++) {
const like = commentReply.likes[i];
if (user._id === like) {
Expand Down
3 changes: 1 addition & 2 deletions client/src/components/EditComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { useSelector, useDispatch } from "react-redux";
import PropTypes from "prop-types";
import { Picker } from "emoji-mart";
import "emoji-mart/css/emoji-mart.css";
// import "emoji-mart/css";

import {
getComments,
Expand Down Expand Up @@ -40,7 +40,6 @@ const EditComment = ({ photoId, commentId, closeEditComment }, props) => {
const handleSubmit = (e) => {
e.preventDefault();
let updatedComment = comment;
console.log(updatedComment);
dispatch(editComment(photoId, commentId, updatedComment));
setTimeout(() => {
closeEditComment();
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/EditPhoto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const EditPhoto = (props) => {
};

const fileSelectedHandler = (e) => {
console.log(e.target.files[0]);
const file = e.target.files[0];
setUpdatedImage(file);
setFileInput(e.target.value);
Expand All @@ -96,7 +95,6 @@ const EditPhoto = (props) => {
const result = reader.result;
setPreviewSource(result);
setIsImageChanged(true);
console.log("before file preview", photo);
photo.image = result;
setPhoto({
...photo,
Expand Down
4 changes: 0 additions & 4 deletions client/src/components/EditUser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const EditUser = (props) => {
// const [err, loadedUser] = useUser();
const isAuthenticated = useSelector((state) => state.user.isAuthenticated);
const isGoogleUser = useSelector((state) => state.user.isGoogleUser);
console.log(isGoogleUser)
const [isImageEditing, setIsImageEditing] = useState(false);
const [updatedImage, setUpdatedImage] = useState(null);
const [previewSource, setPreviewSource] = useState(null);
Expand All @@ -35,7 +34,6 @@ const EditUser = (props) => {
const id = props.match.params.id;

const handleSubmit = (e) => {
console.log('calling', user)
e.preventDefault();
user.medium = mediumArr;
if (isImageChanged) {
Expand Down Expand Up @@ -126,15 +124,13 @@ const EditUser = (props) => {
mediumArr.splice(mediumIndex, 1);
setMediumArr([...mediumArr]);
};

let { name, email, avatar, medium, bio } = user;
if (avatar === undefined || avatar === "") {
avatar =
"https://i2.wp.com/www.winhelponline.com/blog/wp-content/uploads/2017/12/user.png?fit=256%2C256&quality=100&ssl=1";
}

return (

<div className="edit-user">
<form onSubmit={handleSubmit} className="edit-user__form animate-modal">
<div className="edit-user__cancel-wrapper">
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ErrorLoading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ const ErrorLoading = ({ refreshPage }) => {
export default ErrorLoading;
ErrorLoading.propTypes = {
refreshPage: PropTypes.func
};
};
Empty file.
2 changes: 1 addition & 1 deletion client/src/components/Footer/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions client/src/components/LikeComment/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import React, { useState, useEffect } from "react";
import { NavLink } from "react-router-dom";
import { useSelector, useDispatch } from "react-redux";

import {
getComment,
getComments,
getCommentLikes,
likeComment,
} from "../../redux/actions/commentActions";
import CommentLike from "../CommentLike/index";

import "../LikePhoto/style.scss";
import "./style.scss";

const LikeComment = ({ photoId, commentId, likes, history, match }, props) => {
const dispatch = useDispatch();

const isAuthenticated = useSelector((state) => state.auth.isAuthenticated);
const user = useSelector((state) => state.auth.user);
const likedComment = useSelector((state) => state.comments.comment);
const commentLikes = useSelector((state) => state.comments.commentLikes);

// const isCommentLiked = useSelector((state) => state.comments.isCommentLiked);
const [isLikesShowing, setIsLikeShowing] = useState(false);

const handleSubmit = (e) => {
e.preventDefault();
if (!isAuthenticated && !user) {
history.push("/login");
} else {
if (isAuthenticated && user) {
dispatch(getComment(match.params.id, commentId));
dispatch(likeComment(photoId, commentId, likedComment));

setTimeout(() => {
dispatch(getComments(photoId));
dispatch(getCommentLikes(photoId, commentId));
}, 1500);
}
}
};

useEffect(() => {
dispatch(getCommentLikes(photoId, commentId));
}, [dispatch]);

const showCommentLikes = () => {
setIsLikeShowing(true);
};
const closeCommentLikes = () => {
setIsLikeShowing(false);
};

const formattedLikes = commentLikes.map((like) => (
<CommentLike
key={like._id}
userId={like._id}
avatar={like.avatar}
name={like.name}
/>
));

if (!likedComment) {
return <p>loading...</p>;
}
return (
<div className="like-comment__form__container">
<form className="like-container" onSubmit={handleSubmit}>
{isAuthenticated &&
commentLikes.some((like) => like._id === user._id) ? (
<button className="like-comment__btn grow">
<i className="fas fa-heart full-heart"></i> Unlike
</button>
) : (
<button className="like-comment__btn grow">
<i className="far fa-heart empty-heart"></i> Like
</button>
)}
{likes.length > 0 ? (
<NavLink
to={`/photos/${photoId}/comments/${commentId}/likes`}
className="likes-number grow"
onClick={showCommentLikes}
>
{likes.length}
{likes.length === 1 ? (
<span className="like-comments-num"> Like</span>
) : (
<span> Likes</span>
)}
</NavLink>
) : null}
</form>
{isLikesShowing ? (
<div className="likes-comments-box">
<div className="likes-comments-box__header">
<NavLink
to={`/photos/${photoId}/comments/`}
onClick={closeCommentLikes}
>
<i className="fas fa-times-circle grow"></i>
</NavLink>
</div>
<div className="likes-comments-box__body">{formattedLikes}</div>
</div>
) : null}
</div>
);
};

export default LikeComment;
Loading