mirror of
https://github.com/adoyle0/thaw.git
synced 2025-02-02 08:34:15 -05:00
feat: cargo fmt and check (#120)
This commit is contained in:
parent
4690b8d95d
commit
a86ec83106
7 changed files with 38 additions and 48 deletions
|
@ -234,6 +234,7 @@ pub fn Button(
|
|||
style=move || {
|
||||
format!("{}{}", css_vars.get(), style.as_ref().map(|s| s.get()).unwrap_or_default())
|
||||
}
|
||||
|
||||
disabled=move || disabled.get()
|
||||
on:click=on_click
|
||||
>
|
||||
|
|
|
@ -84,8 +84,7 @@ pub fn Icon(
|
|||
stroke=move || take(icon_stroke)
|
||||
fill=move || take(icon_fill)
|
||||
inner_html=move || take(icon_data)
|
||||
>
|
||||
</svg>
|
||||
></svg>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::time::Duration;
|
||||
use super::{message_environment::MessageEnvironment, MessageVariant};
|
||||
use crate::{
|
||||
components::Teleport,
|
||||
utils::{class_list::class_list, mount_style},
|
||||
};
|
||||
use leptos::*;
|
||||
use std::time::Duration;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Default, Clone)]
|
||||
|
|
|
@ -80,23 +80,17 @@ pub fn Modal(
|
|||
on_enter
|
||||
let:display
|
||||
>
|
||||
<div
|
||||
class="thaw-modal-scroll"
|
||||
style=move || display.get()
|
||||
ref=scroll_ref
|
||||
>
|
||||
<div
|
||||
class="thaw-modal-body"
|
||||
ref=modal_ref
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
<div class="thaw-modal-scroll" style=move || display.get() ref=scroll_ref>
|
||||
<div class="thaw-modal-body" ref=modal_ref role="dialog" aria-modal="true">
|
||||
<Card>
|
||||
<CardHeader slot>
|
||||
<span class="thaw-model-title">{move || title.get()}</span>
|
||||
</CardHeader>
|
||||
<CardHeaderExtra slot>
|
||||
<span style="cursor: pointer;" on:click=move |_| show.set(false)>
|
||||
<span
|
||||
style="cursor: pointer;"
|
||||
on:click=move |_| show.set(false)
|
||||
>
|
||||
<Icon icon=icondata_ai::AiCloseOutlined/>
|
||||
</span>
|
||||
</CardHeaderExtra>
|
||||
|
|
|
@ -42,9 +42,7 @@ pub fn Radio(
|
|||
>
|
||||
<input class="thaw-radio__input" type="radio" prop:value=move || value.get()/>
|
||||
<div class="thaw-radio__dot"></div>
|
||||
<div class="thaw-radio__label">
|
||||
{children.map(|children| children())}
|
||||
</div>
|
||||
<div class="thaw-radio__label">{children.map(|children| children())}</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,9 +36,6 @@ pub fn RadioItem(
|
|||
</Radio>
|
||||
}
|
||||
} else {
|
||||
view! {
|
||||
<Radio class value=(is_checked, checked.write_only())>
|
||||
</Radio>
|
||||
}
|
||||
view! { <Radio class value=(is_checked, checked.write_only())/> }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
use leptos::{ev, on_cleanup, window_event_listener, ReadSignal, RwSignal, SignalSet};
|
||||
use leptos::{ReadSignal, RwSignal};
|
||||
|
||||
pub fn use_click_position() -> ReadSignal<Option<(i32, i32)>> {
|
||||
let mouse_position = RwSignal::new(None);
|
||||
#[cfg(any(feature = "csr", feature = "hydrate"))]
|
||||
{
|
||||
use leptos::{ev, on_cleanup, window_event_listener, SignalSet};
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::MouseEvent;
|
||||
|
||||
|
@ -24,11 +30,6 @@ fn click_handler(event: MouseEvent) -> Option<(i32, i32)> {
|
|||
Some((0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn use_click_position() -> ReadSignal<Option<(i32, i32)>> {
|
||||
let mouse_position = RwSignal::new(None);
|
||||
#[cfg(any(feature = "csr", feature = "hydrate"))]
|
||||
{
|
||||
let handle = window_event_listener(ev::click, move |event| {
|
||||
let position = click_handler(event);
|
||||
mouse_position.set(position);
|
||||
|
|
Loading…
Add table
Reference in a new issue