-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented Tailwind / Added Forms #48
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a589ca5
Add user TS interfaces
31d1c83
Add new form components
a3a20a4
Add proper forms and routing
fab28fd
Clean up code for readability
3ac2614
Implement correct routing to proper pages
29c70b4
Implement TailwindCSS
be13c53
Implemented Tailwind to add forms, updated GeoJSON
a0750a8
Remove navigation for deployment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,8 +1,9 @@ | ||
.App { | ||
background-color: #d0c5b9; | ||
max-height: 100vh; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
font-family: 'Satisfy', cursive; | ||
font-family: "Satisfy", cursive; | ||
justify-content: space-between; | ||
padding-bottom: 5rem; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
.acct-form-container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
margin-top: 5rem; | ||
background-color: rgba(255, 255, 255, 0.8); | ||
border-radius: 0.9375rem; | ||
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1); | ||
padding: 2rem; | ||
margin: 5rem auto 2rem; | ||
width: 90%; | ||
max-width: 25rem; | ||
font-family: "Abel", sans-serif; | ||
gap: 1.25rem; | ||
} | ||
|
||
form { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
width: 100%; | ||
} | ||
|
||
.acct-form-container h2 { | ||
text-align: center; | ||
color: #333; | ||
font-family: "Satisfy", cursive; | ||
font-size: 2rem; | ||
|
||
} | ||
|
||
.acct-form-container input { | ||
border: 2px solid #82aa9f; | ||
border-radius: 5px; | ||
padding: 0.625rem; | ||
font-size: 1rem; | ||
color: #333; | ||
width: 100%; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.acct-form-container input::placeholder { | ||
color: #666; | ||
} | ||
|
||
.acct-form-container button { | ||
background-color: #82aa9f; | ||
color: white; | ||
padding: 0.625rem 1.25rem; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
transition: background-color 0.5s ease; | ||
width: 100%; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.acct-form-container button:hover { | ||
background-color: #f0a200; | ||
} | ||
|
||
/* Adjustments for larger screens */ | ||
@media screen and (min-width: 750px) { | ||
.acct-form-container { | ||
width: 80%; | ||
max-width: 500px; | ||
} | ||
} |
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,3 +1,52 @@ | ||
import React, { useState } from 'react'; | ||
import { NewUser } from "../../apiTypes"; | ||
import './CreateAcctForm.css'; | ||
|
||
function CreateAcctForm() { | ||
const [formData, setFormData] = useState<NewUser>({ name: '', email: '', password: '' }) | ||
|
||
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const { name, value } = event.target | ||
setFormData({ ...formData, [name]: value }) | ||
}; | ||
|
||
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => { | ||
event.preventDefault() | ||
// console.log(formData) | ||
}; | ||
|
||
return ( | ||
<div className="acct-form-container"> | ||
<h2>Create Account</h2> | ||
<form onSubmit={handleSubmit}> | ||
<input | ||
type="text" | ||
name="name" | ||
placeholder="Name" | ||
value={formData.name} | ||
onChange={handleChange} | ||
required | ||
/> | ||
<input | ||
type="email" | ||
name="email" | ||
placeholder="Email" | ||
value={formData.email} | ||
onChange={handleChange} | ||
required | ||
/> | ||
<input | ||
type="password" | ||
name="password" | ||
placeholder="Password" | ||
value={formData.password} | ||
onChange={handleChange} | ||
required | ||
/> | ||
<button type="submit">Submit</button> | ||
</form> | ||
</div> | ||
) | ||
} | ||
|
||
export default CreateAcctForm; |
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,61 @@ | ||
.login-form-container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
margin-top: 5rem; | ||
background-color: rgba(255, 255, 255, 0.8); | ||
border-radius: 0.9375rem; | ||
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1); | ||
padding: 2rem; | ||
margin: 5rem auto 2rem; | ||
width: 90%; | ||
max-width: 25rem; | ||
font-family: 'Abel', sans-serif; | ||
gap: 1.25rem; | ||
} | ||
|
||
.login-form-container h2 { | ||
text-align: center; | ||
color: #333; | ||
font-family: 'Satisfy', cursive; | ||
font-size: 2rem; | ||
} | ||
|
||
.login-form-container input { | ||
border: 2px solid #82aa9f; | ||
border-radius: 5px; | ||
padding: 0.625rem; | ||
font-size: 1rem; | ||
color: #333; | ||
width: 100%; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.login-form-container input::placeholder { | ||
color: #666; | ||
} | ||
|
||
.login-form-container button { | ||
background-color: #82aa9f; | ||
color: white; | ||
padding: 0.625rem 1.25rem; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
transition: background-color 0.5s ease; | ||
width: 100%; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.login-form-container button:hover { | ||
background-color: #f0a200; | ||
} | ||
|
||
/* Adjustments for larger screens */ | ||
@media screen and (min-width: 750px) { | ||
.login-form-container { | ||
width: 80%; | ||
max-width: 500px; | ||
} | ||
} |
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,2 +1,44 @@ | ||
import React, { useState } from 'react'; | ||
import { UserCredentials } from "../../apiTypes"; | ||
import { UserCredentials } from "../../apiTypes"; | ||
import './LoginForm.css'; | ||
|
||
function LoginForm() { | ||
const [credentials, setCredentials] = useState<UserCredentials>({ email: '', password: '' }); | ||
|
||
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const { name, value } = event.target; | ||
setCredentials({ ...credentials, [name]: value }) | ||
}; | ||
|
||
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => { | ||
event.preventDefault() | ||
// console.log(credentials) | ||
}; | ||
|
||
return ( | ||
<div className="login-form-container"> | ||
<h2>Login</h2> | ||
<form onSubmit={handleSubmit}> | ||
<input | ||
type="email" | ||
name="email" | ||
placeholder="Email" | ||
value={credentials.email} | ||
onChange={handleChange} | ||
required | ||
/> | ||
<input | ||
type="password" | ||
name="password" | ||
placeholder="Password" | ||
value={credentials.password} | ||
onChange={handleChange} | ||
required | ||
/> | ||
<button type="submit">Submit</button> | ||
</form> | ||
</div> | ||
) | ||
} | ||
|
||
export default LoginForm; |
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 |
---|---|---|
|
@@ -38,7 +38,6 @@ body, html { | |
.map-wrapper >h2 { | ||
font-size: xx-large; | ||
} | ||
|
||
|
||
} | ||
|
||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making a note of this rule for min-height vs max-height and padding bottom bc it's working effectively on my branch with max height and no padding.