Skip to content

Commit d8ec60b

Browse files
committed
rewrite git history
1 parent d2af322 commit d8ec60b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+33842
-24558
lines changed

README.md

Lines changed: 51 additions & 443 deletions
Large diffs are not rendered by default.

client/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
# misc
1515
.DS_Store
16+
.env
1617
.env.local
1718
.env.development.local
1819
.env.test.local

client/package-lock.json

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

client/package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@emoji-mart/data": "^1.0.6",
7+
"@emoji-mart/react": "^1.0.1",
68
"@testing-library/jest-dom": "^4.2.4",
79
"@testing-library/react": "^9.3.2",
810
"@testing-library/user-event": "^7.1.2",
911
"axios": "^0.21.1",
10-
"emoji-mart": "^3.0.0",
12+
"emoji-mart": "^5.2.2",
1113
"moment": "^2.29.1",
14+
"node-sass": "^8.0.0",
1215
"react": "^16.13.1",
1316
"react-dom": "^16.13.1",
1417
"react-facebook-login": "^4.1.1",
1518
"react-google-login": "^5.2.2",
16-
"react-js-pull-to-refresh": "^1.2.2",
1719
"react-paginate": "^6.3.2",
1820
"react-redux": "^7.2.0",
1921
"react-router-dom": "^5.2.0",
20-
"react-scripts": "^3.4.3",
22+
"react-scripts": "^5.0.1",
2123
"react-validator": "^0.1.0",
2224
"redux": "^4.0.5",
2325
"redux-saga": "^1.1.3",
@@ -26,11 +28,11 @@
2628
},
2729
"scripts": {
2830
"start": "react-scripts start",
29-
"build": "react-scripts build",
31+
"build": "DISABLE_ESLINT_PLUGIN=true react-scripts build",
3032
"test": "react-scripts test",
3133
"eject": "react-scripts eject"
3234
},
33-
"proxy": "http://localhost:5000/",
35+
"proxy": "http://localhost:5000",
3436
"eslintConfig": {
3537
"extends": "react-app"
3638
},

client/src/Routes.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Route, Switch } from "react-router-dom";
33
import { useSelector, useDispatch } from "react-redux";
44

55
import { getPhotos } from "./redux/actions/photoActions";
6-
import { getUsers } from "./redux/actions/userActions";
6+
import { getUsers, getUser } from "./redux/actions/userActions";
77
import Navbar from "./components/Navbar";
88
import Community from "./pages/Community";
99
import Register from "./pages/Register";
@@ -33,10 +33,14 @@ const Routes = () => {
3333
const user = useSelector((state) => state.user);
3434
const [isPopupOpen, setIsPopupOpen] = useState(false);
3535
const [isEditPopupOpen, setIsEditPopupOpen] = useState(false);
36-
36+
37+
// TODO fix later on
3738
useEffect(() => {
3839
dispatch(getPhotos());
3940
dispatch(getUsers());
41+
if(user.user) {
42+
dispatch(getUser(user?.user._id));
43+
}
4044
}, [dispatch]);
4145

4246
const closePopup = () => {

client/src/components/AddComment/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import React, { useState } from "react";
22
import { useDispatch } from "react-redux";
33
import PropTypes from "prop-types";
4-
import { Picker } from "emoji-mart";
5-
import "emoji-mart/css/emoji-mart.css";
4+
import Picker from "@emoji-mart/react";
65

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

9-
108
import "./style.scss";
119

1210
const AddComment = ({ photoId, closeCommentField, setCommentClose }, props) => {
@@ -35,6 +33,8 @@ const AddComment = ({ photoId, closeCommentField, setCommentClose }, props) => {
3533
const { text } = comment;
3634

3735
const addEmoji = (e) => {
36+
console.log(e)
37+
3838
let emoji = e.native;
3939
setComment({
4040
text: text + emoji,
@@ -67,7 +67,7 @@ const AddComment = ({ photoId, closeCommentField, setCommentClose }, props) => {
6767
className="add-comment-form__emoji-menu animate-pop hide-tablet-mobile"
6868
onMouseLeave={closeMenu}
6969
>
70-
<Picker onSelect={addEmoji} emojiTooltip={true} />
70+
<Picker onEmojiSelect={addEmoji} emojiTooltip={true} />
7171
</span>
7272
</>
7373
) : (

client/src/components/AddCommentLikeForm/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { useSelector, useDispatch } from "react-redux";
2+
import { useSelector } from "react-redux";
33
import PropTypes from "prop-types";
44

55
import "./style.scss";

client/src/components/AddCommentReply/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React, { useState } from "react";
22
import { useDispatch } from "react-redux";
33
import PropTypes from "prop-types";
4-
import { Picker } from "emoji-mart";
5-
import "emoji-mart/css/emoji-mart.css";
6-
4+
import Picker from "@emoji-mart/react";
75
import {
86
getComments,
97
addCommentReply,
@@ -70,7 +68,7 @@ const AddCommentReply = ({ photoId, commentId, closeCommentReply }) => {
7068
className="add-commentreply-form__emoji-menu animate-pop hide-tablet-mobile"
7169
onMouseLeave={closeMenu}
7270
>
73-
<Picker onSelect={addEmoji} emojiTooltip={true} />
71+
<Picker onEmojiSelect={addEmoji} emojiTooltip={true} />
7472
</span>
7573
</>
7674
) : (

client/src/components/AddPhoto/index.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ const AddPhoto = ({ history }) => {
2828
selectedFile: null,
2929
});
3030
const [mediumArr, setMediumArr] = useState([]);
31-
const [isMediumDup, setIsMediumDup] = useState(false)
31+
const [isMediumDup, setIsMediumDup] = useState(false);
3232
const [warning, setWarning] = useState("");
3333

3434
useEffect(() => {
3535
if (!isAuthenticated) {
36-
history.push("/login");
36+
history.push("/login");
3737
}
3838
}, [isAuthenticated, history]);
3939

@@ -85,18 +85,16 @@ const AddPhoto = ({ history }) => {
8585
const addToMedium = (e) => {
8686
e.preventDefault();
8787
const mediumIndex = mediumArr.indexOf(medium);
88-
console.log(medium.length)
8988
if (medium.length < 1) {
9089
setWarning("Please enter a value");
91-
} else
92-
if (mediumIndex !== -1) {
90+
} else if (mediumIndex !== -1) {
9391
setWarning("Tag already present");
94-
prompt('tag already present')
92+
prompt("tag already present");
9593
setIsMediumDup(true);
9694
} else {
9795
setMediumArr([...mediumArr, medium]);
9896
setText({ ...text, medium: "" });
99-
console.log(mediumArr);
97+
10098
setWarning("");
10199
setIsMediumDup(false);
102100
}
@@ -168,9 +166,7 @@ const AddPhoto = ({ history }) => {
168166
type="text"
169167
name="medium"
170168
value={medium}
171-
placeholder={
172-
"eg(oil, acrylics, dripping, photography etc)"
173-
}
169+
placeholder={"eg(oil, acrylics, dripping, photography etc)"}
174170
onChange={handleChange}
175171
/>
176172
<button
@@ -197,7 +193,7 @@ const AddPhoto = ({ history }) => {
197193
))}
198194
</div>
199195
<span className="add-photo__medium-warning">{warning}</span>
200-
{medium.length < 1 || medium !== '' || isMediumDup && warning}
196+
{medium.length < 1 || medium !== "" || (isMediumDup && warning)}
201197
</div>
202198

203199
<div className="add-photo__input-topics">

client/src/components/AddPhoto/style.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
border-radius: 14px;
1717
font-weight: 700;
1818
background-color: white;
19-
width: 43vw;
19+
width: 40rem;
2020
box-shadow: 0 2rem 2rem rgba(172, 159, 159, 0.5);
2121
-webkit-animation-name: animatetop;
2222
-webkit-animation-duration: 0.4s;
@@ -27,7 +27,7 @@
2727
&__cancel-wrapper {
2828
display: flex;
2929
justify-content: flex-end;
30-
width: 39vw;
30+
width: 100%;
3131
}
3232

3333
&__input-topics {

0 commit comments

Comments
 (0)