Skip to content

Commit

Permalink
aaaaaaaaaaaahhhhhh
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubix982 committed Dec 28, 2020
1 parent 717da38 commit fe56ca5
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/src/components/LoginUserContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const loginUserContext = createContext();

const LoginUserProvider = ({ children }) => {
const loginState = useState((localStorage.getItem('loggedIn') === 'true') ? true : false);
const firstLoginState = useState((localStorage.getItem('loggedIn') === 'true') ? true : false);
const firstLoginState = useState((localStorage.getItem('firstLogin') === 'true') ? true : false);
const verifiedState = useState((localStorage.getItem('verified') === 'true') ? true : false);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Navbar = () => {
history.push('/login');
}, 2000);
} catch (error) {
alert(`Unable to log out, due to error "${error.message}"`)
// alert(`Unable to log out, due to error "${error.message}"`)
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Notification/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ContentLike = ({ content }) => {
<div className={ComponentStyling.content}>
{data.map((element) => {
return (
<SingleNotifLike key={element._id} profilePicture={element.profilePicture} userHandle={element.for} post={element.post} />
<SingleNotifLike key={element._id} profilePicture={element.profilePicture} userHandle={element.by} post={element.post} />
)
})}
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Notification/SingleNotif.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const SingleNotifLike = ({ profilePicture, userHandle, post }) => (
<div className={SingleNotifStyling.postBody}>
<div className={SingleNotifStyling.postText}>
<p>
<span className={SingleNotifStyling.UserNameHandle}>{userHandle} </span>
<span className={SingleNotifStyling.UserNameHandle}>@{userHandle} </span>
liked your post!
</p>
</div>
Expand Down
13 changes: 9 additions & 4 deletions client/src/components/Verify/MainContent.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import React, { useState, useEffect } from 'react';
import { useParams } from 'react-router-dom';
import React, { useState, useEffect, useContext } from 'react';
import { useHistory, useParams } from 'react-router-dom';
import { CenterAlign } from '../FlexAlignment';
import Logo from '../../assets/img/icon/Logo.svg';
import ComponentStyling from '../../style/Error/MainContent.module.css';
import { verifyUser } from '../../services/verify';
import { loginUserContext } from '../LoginUserContext';

const MainContent = () => {
const { hash } = useParams();
const [loading, setLoading] = useState(true);
const [loading, setLoading] = useState(true);
const { verified } = useContext(loginUserContext)
const history = useHistory();

useEffect(async () => {
try {
const status = await verifyUser(hash);
setLoading(!status);
verified.setter(true);
history.push('/feed')
} catch (error) {
alert(error.message);
}
}, [])

if(loading) {
if (loading) {
return (
<>
</>
Expand Down
10 changes: 8 additions & 2 deletions client/src/pages/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ import { loginUserContext } from '../components/LoginUserContext';
// the div is for navbar
import Navbar from '../components/Navbar';
import Home from './home';
import FirstLogin from './FirstLogin';
import Verify from './Verify';

const Feed = () => {
const { login } = useContext(loginUserContext);
const { login, firstLogin, verified } = useContext(loginUserContext);

if (firstLogin.state) {
return (<FirstLogin />);
}

if (login.state) {
return (
Expand All @@ -18,7 +24,7 @@ const Feed = () => {
gridTemplateRows: '10% 90%',
}}
>
<Navbar first_name="Tashik" title="Terrabuzz" />
<Navbar/>
<MainContent />
</Container>
)
Expand Down
1 change: 1 addition & 0 deletions server/services/postFirstLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const postUserInformationForBio = async (__handler, __userInformationBlob) => {
let result; let
query;
try {
console.log(`handler is ${__handler}`);
result = await ValidationSet.findById(__handler);
result.isFirstLogin = false;

Expand Down

1 comment on commit fe56ca5

@vercel
Copy link

@vercel vercel bot commented on fe56ca5 Dec 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.