Skip to content

Commit

Permalink
feat(web): login view (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Liendo authored Jun 30, 2024
1 parent 223fe5f commit b8beb12
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod views;
use leptos::{component, view, IntoView};
use leptos_meta::{provide_meta_context, Title};
use leptos_router::{Route, Router, Routes};
use views::login::Login;

use crate::views::home::Home;

Expand All @@ -16,6 +17,7 @@ pub fn App() -> impl IntoView {
<Router>
<Routes>
<Route path="/" view=Home/>
<Route path="/login" view=Login/>
</Routes>
</Router>
}
Expand Down
24 changes: 24 additions & 0 deletions crates/web/src/views/login.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use crate::components::text_field::{TextField, TextFieldType};
use leptos::{component, view, IntoView};

use crate::components::button::{Button, ButtonVariant};

#[component]
pub fn Login() -> impl IntoView {
view! {
<div class="min-h-screen relative flex justify-center items-center bg-no-repeat bg-cover bg-slate-800 bg-[url('https://images.unsplash.com/photo-1580192985016-7e15ef081dd8?q=80&w=1961&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D')]">
<div class="absolute bg-black rounded-[50%] w-full h-full blur-[23rem]"></div>
<div class="flex justify-center items-center z-20">
<div class="w-full">
<h1 class="text-6xl text-center font-bold text-white mb-16">TownHall</h1>
<form class="w-96">
<TextField class="w-full" name="email" placeholder="Email" />
<TextField class="w-full" name="password" r#type=TextFieldType::Password placeholder="Password" />
<Button class="w-full mt-3" variant={ButtonVariant::Contained}>Log in</Button>
</form>
<div class="text-center w-full text-white mt-3">{"Don't have an account? "}<a class="underline" href="/signup">Sign up!</a></div>
</div>
</div>
</div>
}
}
1 change: 1 addition & 0 deletions crates/web/src/views/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod home;
pub mod login;

0 comments on commit b8beb12

Please sign in to comment.