Skip to content

Commit

Permalink
chore: moving to the button compoent
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Liendo committed Sep 14, 2024
1 parent 3a29836 commit c533142
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
9 changes: 4 additions & 5 deletions crates/web/src/components/auth/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use leptos::{

use townhall_client::Client;

use crate::components::button::{Button, ButtonType, ButtonVariant};
use crate::components::text_field::{TextField, TextFieldType};

#[component]
Expand Down Expand Up @@ -56,12 +57,10 @@ pub fn LoginCard(
placeholder="* * * * * * *"
value=password_value
/>
<button
type="submit"
class="bg-blue-700 text-white font-bold w-full mt-3 rounded-md py-3 px-4"
>

<Button r#type=ButtonType::Submit full_width=true>
Log in
</button>
</Button>
<Show when=move || error_getter.get().is_some()>
<div class="bg-rose-600 text-white p-2 rounded-md">
{error_getter.get().unwrap()}
Expand Down
11 changes: 6 additions & 5 deletions crates/web/src/components/auth/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use leptos::{
use townhall_client::Client;
use townhall_types::user::Email;

use crate::components::button::{Button, ButtonType, ButtonVariant};
use crate::components::text_field::{TextField, TextFieldType};

#[component]
Expand Down Expand Up @@ -83,13 +84,13 @@ pub fn SignupCard(
placeholder="Password"
value=password_value
/>
<button
type="button"
on:click=move |_| submit.dispatch(())
class="bg-blue-700 text-white font-bold w-full mt-3 rounded-md py-3 px-4"
<Button
r#type=ButtonType::Button
on:click=move |_| submit.dispatch(())
full_width=true
>
Sign up
</button>
</Button>
<Show when=move || error_getter.get().is_some()>
<div class="bg-rose-600 text-white p-2 rounded-md">
{error_getter.get().unwrap()}
Expand Down

0 comments on commit c533142

Please sign in to comment.