Skip to content

Commit

Permalink
example fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburniske committed Apr 12, 2024
1 parent 0bd4cc2 commit bdc6418
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions example/start-axum/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ use crate::{
button::{BtnSize, BtnVariant, Button},
error_template::{AppError, ErrorTemplate},
};
use leptos::{logging::log, *};
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
use tailwind_fuse::{merge::MergeOptions, *};

#[component]
pub fn App() -> impl IntoView {
Expand Down Expand Up @@ -41,7 +40,6 @@ fn HomePage() -> impl IntoView {
let on_click = move |_| set_count.update(|count| *count += 1);

view! {
// flex-row should be removed.
<div class="flex items-center gap-4 p-10 flex-row">
<Button on:click=on_click size=BtnSize::Lg>
"Click Me: "
Expand Down
6 changes: 3 additions & 3 deletions example/start-axum/src/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ use tailwind_fuse::*;

#[component]
pub fn Button(
#[prop(into, optional)] variant: MaybeSignal<ButtonVariant>,
#[prop(into, optional)] size: MaybeSignal<ButtonSize>,
#[prop(into, optional)] variant: MaybeSignal<BtnVariant>,
#[prop(into, optional)] size: MaybeSignal<BtnSize>,
#[prop(into, optional)] class: MaybeSignal<String>,
#[prop(attrs)] attributes: Vec<(&'static str, Attribute)>,
children: Children,
) -> impl IntoView {
let class = create_memo(move |_| {
let variant = variant.get();
let size = size.get();
let button = ButtonClass { variant, size };
let button = Btn { variant, size };
button.with_class(class.get())
});

Expand Down

0 comments on commit bdc6418

Please sign in to comment.