-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
214 additions
and
19 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
Week-13-Intro_to_React_Webpack_Components_and_JSX/pages/about.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>About</title> | ||
</head> | ||
<body> | ||
<!--Navigation Bar--> | ||
<header id="root"> | ||
<script type="module" src="/src/navins.jsx"></script> | ||
</header> | ||
|
||
<!--Main Content--> | ||
<br><br> | ||
<div id="wrapper"> | ||
<div id="content"> | ||
<h1>About the Author: </h1> | ||
|
||
<h3>Patrick Corcoran</h3> | ||
<p >Front End Web Development Student and all around guitar nerd</p> | ||
<p >Feel free to check out my Github Repository and YouTube Channel</p><br><br> | ||
</div> | ||
<!--Table for Exterior Links--> | ||
<div id="ctable"> | ||
<table> | ||
<tr> | ||
<th>Site</th> | ||
<th>Link</th> | ||
</tr> | ||
<tr> | ||
<td>GitHub Repository</td> | ||
<td><a href="https://github.com/Fraju-pc" target="_blank">Visit My Github</a></td> | ||
</tr> | ||
<tr> | ||
<td>YouTube Channel</td> | ||
<td><a href="https://www.youtube.com/channel/UC5VxCk3XPxpuq1XyBEo3UcQ" target="_blank">Visit My YouTube</a></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
35 changes: 35 additions & 0 deletions
35
Week-13-Intro_to_React_Webpack_Components_and_JSX/pages/contact.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Contact</title> | ||
|
||
</head> | ||
<body> | ||
<!--Navigation Bar--> | ||
<header id="root"> | ||
<script type="module" src="/src/navins.jsx"></script> | ||
</header> | ||
|
||
<!--Main Content--> | ||
<br><br> | ||
<div id="wrapper"> | ||
<div id="content"> | ||
<h3>Contact Me</h3> | ||
<br> | ||
<br> | ||
<p>Feel free to fill out the form below and I will get back to you via Email</p><br> | ||
</div> | ||
<!--Form--> | ||
<div class="loginForm"> | ||
<form> | ||
<input type="text" name="firstName" placeholder="Enter First Name"><br><br> | ||
<input type="text" name="lastName" placeholder="Last Name"><br><br> | ||
<input type="text" name="email" placeholder="Email Address"><br><br> | ||
<button id="submit" type="submit" value="submit">Submit</button> | ||
</form> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
23 changes: 23 additions & 0 deletions
23
Week-13-Intro_to_React_Webpack_Components_and_JSX/pages/landing.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Landing Page</title> | ||
</head> | ||
<body> | ||
<!--Navigation Bar--> | ||
<header id="root"> | ||
<script type="module" src="/src/navins.jsx"></script> | ||
</header> | ||
|
||
<!--Main Content--> | ||
<br><br> | ||
<div id="wrapper"> | ||
<div id="content"> | ||
<h1>Hey You Made It! </h1> | ||
</div> | ||
|
||
</div> | ||
</body> | ||
</html> |
73 changes: 58 additions & 15 deletions
73
Week-13-Intro_to_React_Webpack_Components_and_JSX/src/LoginForm.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,65 @@ | ||
import { useState } from "react" | ||
|
||
export default function LoginForm(){ | ||
//States to pull from form | ||
const [userName, setUserName] = useState(""); | ||
const [passWord, setPassWord] = useState(""); | ||
|
||
const handleLogin = (e) => { | ||
|
||
e.preventDefault(); | ||
|
||
// console.log('Username:', username); | ||
// console.log('Password:', password); | ||
|
||
//default array of users, keeping it pretty simple here | ||
const users = [ | ||
{ username: 'Admin', password: 'asdf', id: 1 }, | ||
{ username: 'User1', password: 'qwer', id: 2 }, | ||
{ username: 'User2', password: 'uiop', id: 3 }, | ||
]; | ||
//check for match | ||
const matchedUser = users.find( | ||
(user) => user.username === userName && user.password === passWord | ||
); | ||
|
||
if (matchedUser) { | ||
// Redirect to the new webpage | ||
window.location.href = '../pages/landing.html'; | ||
} else { | ||
// alert for no match | ||
alert('Invalid username or password'); | ||
|
||
} | ||
|
||
}; | ||
//html form | ||
return ( | ||
<div className="loginForm"> | ||
<form> | ||
<label for="username">User Name:</label><br/> | ||
<input type="text" id="username" placeholder="User Name"/> | ||
|
||
<> | ||
<br/> | ||
<br/> | ||
<div id="wrapper"> | ||
<h3>Log In</h3> | ||
<br/> | ||
<div className="loginForm"> | ||
<form onSubmit={handleLogin}> | ||
<label for="username">User Name:</label><br/> | ||
<input type="text" id="username" value={userName} placeholder="User Name" | ||
onChange={(e) => setUserName(e.target.value)} /> | ||
|
||
<br/><br/> | ||
<br/><br/> | ||
|
||
<label for="password">Password:</label><br/> | ||
<input type="password" class="form-control" id="password" placeholder="Password"/> | ||
<label for="password">Password:</label><br/> | ||
<input type="password" class="form-control" id="password" value={passWord} placeholder="Password" | ||
onChange={(e) => setPassWord(e.target.value)} /> | ||
|
||
|
||
<br/><br/> | ||
<button id="login" type="submit">Login</button> | ||
|
||
</form> | ||
</div> | ||
<br/><br/> | ||
<button id="login" type="submit">Login</button> | ||
</form> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Week-13-Intro_to_React_Webpack_Components_and_JSX/src/navins.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import NavBar from './NavBar.jsx' | ||
import "../src/app.css" | ||
|
||
|
||
ReactDOM.createRoot(document.getElementById('root')).render( | ||
<React.StrictMode> | ||
<NavBar /> | ||
</React.StrictMode>, | ||
) |