From 35b69eae3f49a3af430fb5a06a8bc904c2768d69 Mon Sep 17 00:00:00 2001 From: QkoSad Date: Thu, 18 May 2023 20:17:22 +0300 Subject: [PATCH] before start updating to new redux --- .gitignore | 1 + client/package.json | 2 +- client/src/App.css | 2 +- client/src/App.js | 7 ++- client/src/actions/post.js | 7 +-- client/src/buttontemp.js | 0 client/src/components/dashboard/Dashboard.js | 3 +- client/src/components/layout/Navbar.js | 4 +- client/src/components/posts/PostForm.js | 55 ++++++++++++-------- client/src/index.js | 2 + client/src/reducers/profile.js | 12 ++--- 11 files changed, 53 insertions(+), 42 deletions(-) create mode 100644 client/src/buttontemp.js diff --git a/.gitignore b/.gitignore index 56632cd..d030bb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules default.json .vscode +TODO.txt diff --git a/client/package.json b/client/package.json index 8666bfb..c3e46f8 100644 --- a/client/package.json +++ b/client/package.json @@ -43,5 +43,5 @@ "last 1 safari version" ] }, - "proxy":"http://localhost:5000" + "proxy": "http://localhost:5000" } diff --git a/client/src/App.css b/client/src/App.css index c8f207d..9a25c85 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -582,4 +582,4 @@ button { right: 2rem; display: inline-block; } ->>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb + diff --git a/client/src/App.js b/client/src/App.js index b082990..da37e16 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,5 +1,6 @@ import React, { useEffect } from 'react'; import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; + import Navbar from './components/layout/Navbar'; import Landing from './components/layout/Landing'; import Register from './components/auth/Register'; @@ -25,6 +26,9 @@ import setAuthToken from './utils/setAuthToken'; import './App.css'; +// Level - 1 +// + const App = () => { useEffect(() => { // check for token in LS when app first runs @@ -43,7 +47,8 @@ const App = () => { }, []); return ( - + + // Seting Up redux store diff --git a/client/src/actions/post.js b/client/src/actions/post.js index b140a96..b932dea 100644 --- a/client/src/actions/post.js +++ b/client/src/actions/post.js @@ -11,12 +11,7 @@ import { REMOVE_COMMENT } from './types'; -/* - NOTE: we don't need a config object for axios as the - default headers in axios are already Content-Type: application/json - also axios stringifies and parses JSON for you, so no need for - JSON.stringify or JSON.parse -*/ + // Get posts export const getPosts = () => async (dispatch) => { diff --git a/client/src/buttontemp.js b/client/src/buttontemp.js new file mode 100644 index 0000000..e69de29 diff --git a/client/src/components/dashboard/Dashboard.js b/client/src/components/dashboard/Dashboard.js index 6ac1033..8f5ad2d 100644 --- a/client/src/components/dashboard/Dashboard.js +++ b/client/src/components/dashboard/Dashboard.js @@ -1,4 +1,3 @@ - import React, { useEffect } from 'react'; import { Link } from 'react-router-dom'; import PropTypes from 'prop-types'; @@ -33,7 +32,7 @@ const Dashboard = ({
diff --git a/client/src/components/layout/Navbar.js b/client/src/components/layout/Navbar.js index 8f60200..953af06 100644 --- a/client/src/components/layout/Navbar.js +++ b/client/src/components/layout/Navbar.js @@ -16,7 +16,7 @@ const Navbar = ({ auth: { isAuthenticated }, logout }) => {
  • {' '} - Dashboard + Profile
  • @@ -45,7 +45,7 @@ const Navbar = ({ auth: { isAuthenticated }, logout }) => { return (