diff --git a/README.md b/README.md
index 0c83cde..594edff 100644
--- a/README.md
+++ b/README.md
@@ -1,70 +1,7 @@
-# Getting Started with Create React App
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
-
-## Available Scripts
-
-In the project directory, you can run:
-
-### `npm start`
-
-Runs the app in the development mode.\
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
-
-The page will reload if you make edits.\
-You will also see any lint errors in the console.
-
-### `npm test`
-
-Launches the test runner in the interactive watch mode.\
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
-
-### `npm run build`
-
-Builds the app for production to the `build` folder.\
-It correctly bundles React in production mode and optimizes the build for the best performance.
-
-The build is minified and the filenames include the hashes.\
-Your app is ready to be deployed!
-
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
-
-### `npm run eject`
-
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
-
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
-
-Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
-
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
-
-## Learn More
-
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
-
-To learn React, check out the [React documentation](https://reactjs.org/).
-
-### Code Splitting
-
-This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
-
-### Analyzing the Bundle Size
-
-This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
-
-### Making a Progressive Web App
-
-This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
-
-### Advanced Configuration
-
-This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
-
-### Deployment
-
-This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
-
-### `npm run build` fails to minify
-
-This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
+# Feelingz-An anonymous platform for people
+### This is a prototype-based website which will help people to express their feelings, with identity kept as anonymous. Intention behind this project is to help people to fight their own war against depression.
+## Technology Used
+### Frontend: HTML, CSS, JS (ReactJS)
+### Backend: NodeJS
+### Database: Firebase realtime DB
diff --git a/package.json b/package.json
index 430f906..cfc8c96 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,7 @@
"browserslist": {
"production": [
">0.2%",
- "not dead",
+
"not op_mini all"
],
"development": [
diff --git a/public/index.html b/public/index.html
index 7dc96df..fa9d7bc 100644
--- a/public/index.html
+++ b/public/index.html
@@ -26,6 +26,9 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
+
+
+
React App
diff --git a/src/App.js b/src/App.js
index b3a3a44..1f94440 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,8 +1,8 @@
-import React, { useEffect,useReducer,useState } from "react";
+import React, { useEffect,useReducer } from "react";
import './css/App.css';
//react router
-import {BrowserRouter as Router, Switch,Route,Link} from "react-router-dom";
+import {BrowserRouter as Router, Switch,Route} from "react-router-dom";
//toast
import {ToastContainer} from "react-toastify";
@@ -17,7 +17,7 @@ import "firebase/database"
//ContextAPI STUFF
import reducer from "./Context/reducer";
-import UserContext from "./Context/UserContext";
+
import PostContext from "./Context/PostContext";
import { SET_POST,SET_LOADING } from "./Context/actions.types";
@@ -27,7 +27,7 @@ import LandingBody from './Components/LandingBody';
import SignIn from './Components/SignIn';
import SignUp from './Components/SignUp';
import NotFound from './Components/NotFound';
-import HomePage from "./Components/HomePage";
+
//TODO: create useeffect for calling objects from the database
//initializing Firebase at root page
@@ -43,10 +43,11 @@ const initialState={
postToUpdateKey:null,
isLoading:false,
user:{},//because its storing uuid and email
+ isUpdate:false,
};
function App() {
const [state,dispatch] = useReducer(reducer,initialState);
- const [user,setUser] = useState(null)
+
const getPosts = async () => {
dispatch({
type:SET_LOADING,
@@ -75,9 +76,9 @@ useEffect(()=>{
return (
-
+
+
-
@@ -86,12 +87,12 @@ useEffect(()=>{
-
-
+
+
);
}
diff --git a/src/Components/HomePage.js b/src/Components/HomePage.js
index c4030a8..5fad062 100644
--- a/src/Components/HomePage.js
+++ b/src/Components/HomePage.js
@@ -1,6 +1,6 @@
//This page will be shown after logging in!
-import React,{useState,useContext,useEffect} from 'react'
-import UserContext from "../Context/PostContext";
+import React from 'react'
+
import Posts from './Posts';
import PostSection from './PostSection';
@@ -13,25 +13,10 @@ import PostSection from './PostSection';
//TODO: SET Loading graphics here
//********************************************************************************* */
const HomePage = () => {
- const context=useContext(UserContext);//This was done for fetching the email from the context and displaying Hello to the email
- // const [postsarray,setPostsarray]= useState([]);
- // useEffect(()=>{
- // const localposts = localStorage.getItem("postobject");
- // if(localposts)
- // {
- // setPostsarray(JSON.parse(localposts));//if localposts present,load it on screen
- // }
- // },[]);
-
- // const addPosts = async post => {
- // setPostsarray([...postsarray,post]);
- // }
- // useEffect(() =>{
- // localStorage.setItem("postobject",JSON.stringify(postsarray))
- // },[postsarray]);
+
return (
-
+
diff --git a/src/Components/LandingBody.js b/src/Components/LandingBody.js
index def9c1d..0ca1c78 100644
--- a/src/Components/LandingBody.js
+++ b/src/Components/LandingBody.js
@@ -1,19 +1,21 @@
import React,{useContext} from "react";
-import UserContext from "../Context/UserContext";
+
import "../css/LandingBody.css";
-import {GiThink} from "react-icons/gi";
+
import HomePage from "./HomePage";
import LandingPage from "./LandingPage";
+import PostContext from "../Context/PostContext";
const LandingBody = () =>{
- const context = useContext(UserContext);
-//TODO: Remove user context
+ const {state}=useContext(PostContext);
+ const {user}=state;
+ //TODO: Remove user context
- {
- //console.log("Context",context);
- //alert("LANDINGBODY",context.user);
- if(context.user)
+
+
+ if(user.email)
{
+ console.log(user);
return(
)
@@ -23,8 +25,9 @@ const LandingBody = () =>{
//working!
)
}
- }
-
+
+
+
}
export default LandingBody;
\ No newline at end of file
diff --git a/src/Components/LandingPage.js b/src/Components/LandingPage.js
index 99d8f08..a905d87 100644
--- a/src/Components/LandingPage.js
+++ b/src/Components/LandingPage.js
@@ -8,11 +8,25 @@ const LandingPage = () =>{
return(
Welcome to my website!
+
+ What is website about?
+
- Feelingz is a website which will help people to express their feelings anonymously.
+
Feelingz is a website which will help people to express their feelings anonymously.
+
Your identity is kept completely anonymous here! You just need to login and pour out all feelings which are troubling you!
+