create another button style

This commit is contained in:
Liam Fitzpatrick 2024-12-14 07:37:12 -05:00
parent 9bf4d6124c
commit 9aeecc7dee
2 changed files with 7 additions and 2 deletions

View File

@ -6,7 +6,8 @@ pub enum ButtonStyle {
Secondary,
Success,
Danger,
Warning
Warning,
Cyberpunk
}
#[component]
@ -37,6 +38,9 @@ pub fn Button(
},
ButtonStyle::Warning => {
stylestring = "bg-yellow-500 hover:bg-yellow-700 text-black font-semibold py-2 px-4 rounded";
},
ButtonStyle::Cyberpunk => {
stylestring = "bg-[#0a0c1b] hover:bg-[#171d3a] text-white font-bold py-2 px-4 rounded shadow-lg transition duration-300 ease-in-out transform hover:scale-105";
}
}
logging::log!("{}", stylestring);

View File

@ -5,6 +5,7 @@ use leptos_router::{
StaticSegment,
};
use leptos_components::components::buttons::Button;
use leptos_components::components::buttons::ButtonStyle;
pub fn shell(options: LeptosOptions) -> impl IntoView {
view! {
@ -58,6 +59,6 @@ fn HomePage() -> impl IntoView {
view! {
<h1>"Welcome to Leptos!"</h1>
<button on:click=on_click>"Click Me: " {move || count.get()}</button>
<Button on:click=on_click>"Click Me: " {move || count.get()}</Button>
<Button style=ButtonStyle::Cyberpunk on:click=on_click>"Click Me: " {move || count.get()}</Button>
}
}