Skip to content
Permalink
Browse files
lst changes
  • Loading branch information
bangui committed Jan 10, 2021
1 parent 2554e35 commit ba5b20b4e7ccb38531aa7ceccb38b9e1cf223b76
Show file tree
Hide file tree
Showing 28 changed files with 30 additions and 404 deletions.

Large diffs are not rendered by default.

@@ -1,7 +1,7 @@
import React, {useState} from 'react';
import Products from './Components/Products'
import Cart from './Components/Cart';
import Toolbar from './Navbar/Toolbar';
import Toolbar from './Components/Navbar/Toolbar';
import LogIn from './Components/LogIn';
import SignUp from './Components/SignUp';

This file was deleted.

@@ -35,24 +35,26 @@ function Cart({cart,setCart}){
<h4>{product.author}</h4>
</div>
<div className="price">
<h4>${product.price}</h4>
<h4>£{product.price}</h4>
</div>
<div className="delete-item">
<button onClick={()=>removeFromCart(product)}>
<h1>Remove</h1>
</button>
</div>

</div>

))}

</div>
</div>
<div className="total">
Total Price:${getTotalSum()}
Total Price:£{getTotalSum()}
<br/>
Shipping Price:${shippingPrice}
Shipping Price:£{shippingPrice}
<br/>
Total Cost:${TotalPrice}
Total Cost:£{TotalPrice}
</div>
</div>
)

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import axios from 'axios';

import './SignUp.css'
export class LogIn extends Component {
constructor(props){
@@ -26,23 +26,6 @@ export class LogIn extends Component {
password,
}=this.state;

axios.post("https://localhost:3000/login",
{
user:{
email: email,
password:password,
}
},
{withCredentials:true}
)
.then(response=>{
if(response.data.logged_in){
this.props.handleSuccessfulAuth(response.data);
}
}).catch(error=>{
console.log("login error", error);
});
event.preventDefault();
}
render() {
return (
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,19 @@
import React from 'react';
import './css/SideDrawer.css';
const sideDrawer = props =>{
const {navigateTo}=props
let drawerClasses='side-drawer';
if (props.show){
drawerClasses='side-drawer open';
}
return( <nav className={drawerClasses}>
<ul>
<li onClick={() => navigateTo(PAGE_PRODUCTS)} >ALL BOOKS</li>
<li onClick={() => navigateTo(PAGE_LOGIN)}>LOG IN</li>
<li onClick={() => navigateTo(PAGE_SIGNUP)}>SIGN UP</li>

</ul>
</nav>
);
};
export default sideDrawer;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

This file was deleted.

@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import axios from 'axios';
import './SignUp.css'

export class SignUp extends Component {
@@ -29,21 +28,7 @@ export class SignUp extends Component {
password_confirmation
}=this.state;

axios.post("https://localhost:3000/registrations",
{
user:{
email: email,
password:password,
passsword_confirmation:password_confirmation
}
},
{withCredentials:true}
).then(response=>{
console.log("registration res", response);
}).catch(error=>{
console.log("registation error", error);
});
event.preventDefault();

}
render() {
return (

This file was deleted.

This file was deleted.

0 comments on commit ba5b20b

Please sign in to comment.