-
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.
feat: add .env to .gitignore and implement sign up functionality
- Loading branch information
1 parent
6724955
commit 8b397df
Showing
6 changed files
with
93 additions
and
2 deletions.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SUPABASE_PUBLIC_URL = | ||
SUPABASE_ANON_PUBLIC_KEY = |
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 |
---|---|---|
|
@@ -22,5 +22,9 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
index.html | ||
package-lock.json | ||
.env | ||
|
||
*.html | ||
!template.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,17 @@ | ||
import { load, html } from 'emmy-dom/dist/server.js' | ||
|
||
export function login () { | ||
this.className = 'flex flex-col justify-center items-center text-center w-full h-fit text-gray-800 gap-0' | ||
|
||
return html` | ||
<form class="flex flex-col justify-center items-center text-center w-full h-fit text-gray-800 gap-0"> | ||
<input class="w-[80%] h-[50px] rounded-lg border-2 border-gray-300" type="text" placeholder="Correo electrónico"> | ||
<input class="w-[80%] h-[50px] rounded-lg border-2 border-gray-300" type="password" placeholder="Contraseña"> | ||
<button class="w-[80%] h-[50px] rounded-lg bg-[#384DBF] text-white text-2xl md:text-4xl px-4 py-2 rounded-lg drop-shadow-lg"> | ||
Iniciar sesión | ||
</button> | ||
</form> | ||
` | ||
} | ||
|
||
export const Login = load(login, 'Login') |
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,31 @@ | ||
import { load, html } from 'emmy-dom/dist/server.js' | ||
import { signUpNewUser } from './services/client.js' | ||
|
||
export function signup () { | ||
this.className = 'flex flex-col justify-center items-center text-center w-full h-fit text-gray-800 gap-0' | ||
|
||
const [email, setEmail] = this.useState('') | ||
const [password, setPassword] = this.useState('') | ||
|
||
this.useEffect(() => { | ||
this.querySelector('#signup').addEventListener('submit', async (e) => { | ||
e.preventDefault() | ||
setEmail(e.target[0].value) | ||
setPassword(e.target[1].value) | ||
await signUpNewUser(email, password) | ||
}) | ||
console.log('didMount') | ||
}, ['didMount']) | ||
|
||
return html` | ||
<form class="flex flex-col justify-center items-center text-center w-full h-fit text-gray-800 gap-0" id="signup"> | ||
<input class="w-[80%] h-[50px] rounded-lg border-2 border-gray-300" type="text" placeholder="Correo electrónico"> | ||
<input class="w-[80%] h-[50px] rounded-lg border-2 border-gray-300" type="password" placeholder="Contraseña"> | ||
<button class="w-[80%] h-[50px] rounded-lg bg-[#384DBF] text-white text-2xl md:text-4xl px-4 py-2 rounded-lg drop-shadow-lg" type="submit"> | ||
Registrarse | ||
</button> | ||
</form> | ||
` | ||
} | ||
|
||
export const Signup = load(signup, 'Signup') |
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