hrzlgnm / mdns-browser

A cross platform mDNS-Browser app written in Rust using tauri and leptos
MIT License
4 stars 0 forks source link

Animate verify button for verify duration #558

Closed hrzlgnm closed 4 days ago

hrzlgnm commented 5 days ago

Something along with

let loading = create_rw_signal(false);
let on_click = move |_| {
    loading.set(true);
    set_timeout(
        move || {
            loading.set(false);
        },
        std::time::Duration::new(2, 0),
    );
};

view! {
    <Space>
        <Button loading on_click icon=icondata::AiCloseOutlined>
            "Click Me"
        </Button>
        <Button loading on_click>
            "Click Me"
        </Button>
    </Space>
}
hrzlgnm commented 5 days ago

Also reduce the timeout to 5s