Skip to content

Commit

Permalink
* Updated routes and login added
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgd7 committed May 2, 2024
1 parent 3e17344 commit c873740
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import Home from './views/home/home.js'
import Login from './login'
import Login from './views/login/login.js'
import './App.css'
import { useEffect, useState } from 'react'

Expand Down
49 changes: 49 additions & 0 deletions src/views/login/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React, { useState } from 'react'
import { useNavigate } from 'react-router-dom'

const Login = (props) => {
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const [emailError, setEmailError] = useState('')
const [passwordError, setPasswordError] = useState('')

const navigate = useNavigate()

const onButtonClick = () => {
// You'll update this function later...
}

return (
<div className={'mainContainer'}>
<div className={'titleContainer'}>
<div>Login</div>
</div>
<br />
<div className={'inputContainer'}>
<input
value={email}
placeholder="Enter your email here"
onChange={(ev) => setEmail(ev.target.value)}
className={'inputBox'}
/>
<label className="errorLabel">{emailError}</label>
</div>
<br />
<div className={'inputContainer'}>
<input
value={password}
placeholder="Enter your password here"
onChange={(ev) => setPassword(ev.target.value)}
className={'inputBox'}
/>
<label className="errorLabel">{passwordError}</label>
</div>
<br />
<div className={'inputContainer'}>
<input className={'inputButton'} type="button" onClick={onButtonClick} value={'Log in'} />
</div>
</div>
)
}

export default Login

0 comments on commit c873740

Please sign in to comment.