Skip to content

Commit

Permalink
Authentication & Profile Page Implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadAkthamObeidat committed Jan 24, 2020
1 parent 8316e1a commit 0805ce3
Show file tree
Hide file tree
Showing 9 changed files with 320 additions and 72 deletions.
3 changes: 3 additions & 0 deletions view/src/Assets/CSS/Nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
border: none;
}


.movies-btn {
background-color: rgba(0, 0, 0, 0);
color: white;
Expand All @@ -89,3 +90,5 @@
top: 33%;
min-width: 22px;
}


32 changes: 27 additions & 5 deletions view/src/Assets/CSS/Profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@
.avatar {
border-radius: 50%;
width: 10%;
margin-top: -30%;
margin-left: 45%;
background-color: rgb(182, 182, 182);
padding:1%;
position: absolute;
top: 15%;
left: 45%;
}
.user-name {
display: inline;
text-align: center;
position: absolute;
top: 43%;
color: #fff;
left: 45%;
position: absolute;
top: 36%;
left: 38%;
}
.profile-cover {
position: relative;
width: 100%;
height: 2%;
}
Expand Down Expand Up @@ -53,8 +57,26 @@
display: inline;
align-self: center;
margin: 0 auto;
cursor: pointer;
}

.select-input{
margin-top: -10px;
border-radius: 10px;
padding: 5px;
color: #ed1c24;
border : solid 1px #ed1c24;
}

.header-btns:hover{
color: #ed1c24;
}

.lists {
padding-left: 2%;
}

.empty{
margin: 10% 0 10% 0 ;
max-width: 30%;
}
9 changes: 9 additions & 0 deletions view/src/Assets/CSS/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,13 @@ code {

}

.link-behaviour{
color:white;
}

.link-behaviour:hover{
color:#ed1c24;
text-decoration: none;
}


31 changes: 31 additions & 0 deletions view/src/Assets/Images/Empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions view/src/Assets/Images/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 14 additions & 11 deletions view/src/Layouts/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ import AuthHelper from '../Utils/AuthHelper';
class Home extends Component {
constructor(props) {
super(props);
this.state = {};
this.isLoggedIn = false;
this.userID = '';
this.state = {
isLoggedIn: false,
userID: ''
};
}

componentDidMount = () => {
const Auth = new AuthHelper();
// Auth.getConfirm();
// console.log('Auth.getConfirm :', Auth.getConfirm());
try {
const response = Auth.getConfirm();
this.isLoggedIn = true;
this.userID = response.id;
if (response.id.length > 0) {
this.setState({
isLoggedIn: true,
userID: response.id
});
}
} catch (error) {
console.log('error :', error);
}
Expand All @@ -31,8 +34,8 @@ class Home extends Component {
path="/"
exact
render={() => {
if (!this.isLoggedIn) {
return <Profile/>;
if (this.state.isLoggedIn) {
return <Profile />;
} else {
return (
<div className="home-page">
Expand All @@ -48,8 +51,8 @@ class Home extends Component {
Discover, Organize & Stay Updated.
</p>
<button className="join-btn">
<Link to="/register">
JOIN MOIVES GALAXY IT'S FREE
<Link to="/register" className = 'link-behaviour' >
JOIN MOVIES GALAXY IT'S FREE
</Link>
</button>
</div>
Expand Down
3 changes: 1 addition & 2 deletions view/src/Layouts/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import NavBar from '../components/NavBar';
import '../Assets/CSS/Login.css';
import axios from 'axios';
import AuthHelper from '../Utils/AuthHelper';
import { Redirect } from 'react-router-dom';
import { Link } from 'react-router-dom';
class Login extends Component {
state = {
email: '',
Expand All @@ -24,7 +24,6 @@ class Login extends Component {
const { token } = user.data;
const Auth = new AuthHelper();
Auth.setToken(token);
return <Redirect to="/profile" />;
};

render() {
Expand Down
Loading

0 comments on commit 0805ce3

Please sign in to comment.