Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class App extends Component {
<Route path="/product/:id" component={ProductPage} />
<Route path="/search/:searchInput" component={Shop} />
<Route exact path="/shipping_info" component={shipping_info} />
</div>{' '}
</div>
</Router>
)
}
Expand Down
56 changes: 56 additions & 0 deletions client/src/components/Login/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React, { Component } from 'react'
import './style.css'
import NavBar from '../Navbar'
import axios from 'axios';
class Login extends Component {
state = {

email:'',
password:''


}

emailValue = (event)=>{
const {value} = event.target
this.setState({email:value})
}
passwordValue = (event)=>{
const {value} = event.target

this.setState({password:value})
}
doSomeThing = (e)=>{
console.log("its ok")
const {email,password} =this.state


e.preventDefault();

axios.post(`/login`,{"email":email,"password":password})
.then( ({data}) => {
console.log("data",data)
})

}

render () {
return (

<div>
< NavBar />
<h1 className="login-titel">Login </h1>
<form className="login" onSubmit={this.doSomeThing} >

<input className="input" type="email" autocomplete="on" placeholder="Email" name="email" value={this.state.email} onChange={this.emailValue} required/>
<input className="input" type="password" autocomplete="on" placeholder="Password" name="password" value={this.state.password} onChange={this.passwordValue} required/>
<button type="submit" className="signin-button">Login</button>
<button type="button" className="signup-button">Signup</button>

</form>
</div>
)
}
}

export default Login
143 changes: 143 additions & 0 deletions client/src/components/Login/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
.login {
display: flex;
flex-direction: column;
margin: 5% auto auto auto;
}

.input {
width: 65%;
margin: auto auto 5% auto;
height: 25px;
font-size: 1.2em;
border: 0;
border-bottom: 2px solid black;
padding-left: 1%;
color: #83c102;
}

.signin-button {
height: 63px;
width: 20%;
background: #54bc07;
color: white;
font-size: 1.2em;
border-radius: 5px;
margin: 3% auto;
}

.signin-button:hover {
background: #00a1ec;
color: white;
}

.signup-button {
height: 63px;
width: 20%;
background: #A2A2A2;
color: white;
font-size: 1.2em;
border-radius: 5px;
margin: auto;
}

.signup-button:hover {
background: #00a1ec;
color: white;
}

.login-titel {
text-align: left;
margin: 10% auto auto 10%;
}

@media screen and (max-width:900px) {
.left,
.main,
.right {
width: 100%;
/* The width is 100%, when the viewport is 800px or smaller */
}
.login-titel {
text-align: left;
margin: 15% auto auto 10%;
}
.login {
display: flex;
flex-direction: column;
margin: 10% auto auto auto;
}
.input {
width: 85%;
margin: auto auto 10% auto;
height: 25px;
font-size: 1.2em;
border: 0;
border-bottom: 2px solid black;
padding-left: 1%;
color: #83c102;
}
.signin-button {
height: 63px;
width: 45%;
background: #54bc07;
color: white;
font-size: 1.2em;
border-radius: 5px;
margin: 3% auto;
}
.signup-button {
height: 63px;
width: 45%;
background: #A2A2A2;
color: white;
font-size: 1.2em;
border-radius: 5px;
margin: auto;
}
}

@media screen and (max-width:500px) {
.left,
.main,
.right {
width: 100%;
/* The width is 100%, when the viewport is 800px or smaller */
}
.login-titel {
text-align: left;
margin: 15% auto auto 10%;
}
.login {
display: flex;
flex-direction: column;
margin: 40% auto auto auto;
}
.input {
width: 85%;
margin: auto auto 10% auto;
height: 25px;
font-size: 1.2em;
border: 0;
border-bottom: 2px solid black;
padding-left: 1%;
color: #83c102;
}
.signin-button {
height: 63px;
width: 45%;
background: #54bc07;
color: white;
font-size: 1.2em;
border-radius: 5px;
margin: 3% auto;
}
.signup-button {
height: 63px;
width: 45%;
background: #A2A2A2;
color: white;
font-size: 1.2em;
border-radius: 5px;
margin: auto;
}
}
103 changes: 83 additions & 20 deletions client/src/components/Navbar/style.css
Original file line number Diff line number Diff line change
@@ -1,36 +1,99 @@
.nav-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100vw;
margin: auto;
height: 10vh;
box-shadow: 1px -10px 16px 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100vw;
height: 42px;
margin: auto;
padding-top: 1%;
padding-bottom: 1%;
box-shadow: 1px -10px 16px 7px;
}

.cart-section {
margin-right: 0%;
margin-right: 0%;
}

.logo-section {
display: flex;
flex-direction: row;
display: flex;
flex-direction: row;
}

.cart,
.menu {
width: 23px;
height: 21px;
margin: 10px 6px;

width: 23px;
height: 21px;
margin: 10px 6px;
}

.menu {
margin-right: 27px;
margin-right: 27px;
}

.logo {
width: 98px;
height: 41px;
margin: 3px -28px 0px 31px;
width: 98px;
height: 41px;
margin: 3px -28px 0px 31px;
}

.shop {
margin-top: 15px;
margin-left: 35%;
margin-top: 15px;
margin-left: 35%;
}

@media screen and (max-width:1200px) {
.left,
.main,
.right {
width: 100%;
/* The width is 100%, when the viewport is 800px or smaller */
}
.nav-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100vw;
margin: auto;
padding-top: 1%;
height: 42px;
box-shadow: 1px -10px 16px 7px;
}
}

@media screen and (max-width:800px) {
.left,
.main,
.right {
width: 100%;
/* The width is 100%, when the viewport is 800px or smaller */
}
.nav-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100vw;
margin: auto;
padding-top: 1%;
height: 42px;
box-shadow: 1px -10px 16px 7px;
}
}

@media screen and (max-width:500px) {
.left,
.main,
.right {
width: 100%;
/* The width is 100%, when the viewport is 800px or smaller */
}
.nav-bar {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100vw;
margin: auto;
padding-top: 1%;
height: 42px;
box-shadow: 1px -10px 16px 7px;
}
}
Loading