Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: apply the OverlayDrawer class prop to thaw-overlay-drawer #278

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ leptos_meta = { workspace = true }
leptos_router = { workspace = true }
thaw = { path = "../thaw" }
demo_markdown = { path = "../demo_markdown" }
icondata = "0.3.1"
icondata = { version = "0.4.0", default-features = false, features = [
"ant-design-icons",
"box-icons",
"lucide",
] }
palette = "0.7.6"
chrono = "0.4.38"
cfg-if = "1.0.0"
Expand Down
1 change: 1 addition & 0 deletions thaw/src/drawer/docs/mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ view! {
| Name | Type | Default | Desciption |
| --- | --- | --- | --- |
| class | `MaybeProp<String>` | `Default::default()` | |
| container_class | `MaybeProp<String>` | `Default::default()` | |
| open | `Model<bool>` | | Controls the open state of the Drawer. |
| mask_closeable | `MaybeSignal<bool>` | `true` | Whether to emit hide event when click mask. |
| close_on_esc | `bool` | `false` | Whether to close drawer on Esc is pressed. |
Expand Down
6 changes: 4 additions & 2 deletions thaw/src/drawer/overlay_drawer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use thaw_utils::{class_list, mount_style, use_lock_html_scroll, Model};
#[component]
pub fn OverlayDrawer(
#[prop(optional, into)] class: MaybeProp<String>,
#[prop(optional, into)] container_class: MaybeProp<String>,
/// Controls the open state of the Drawer.
#[prop(into)]
open: Model<bool>,
Expand Down Expand Up @@ -60,7 +61,7 @@ pub fn OverlayDrawer(
<Teleport immediate=open.signal()>
<FocusTrap disabled=!close_on_esc active=open.signal() on_esc>
<div
class=class_list!["thaw-config-provider thaw-overlay-drawer-container", class]
class=class_list!["thaw-config-provider thaw-overlay-drawer-container", container_class]
data-thaw-id=config_provider.id()
>
{if modal_type == DrawerModalType::Modal {
Expand Down Expand Up @@ -99,7 +100,8 @@ pub fn OverlayDrawer(
<div
class=class_list![
"thaw-overlay-drawer",
move || format!("thaw-overlay-drawer--position-{}", position.get().as_str())
move || format!("thaw-overlay-drawer--position-{}", position.get().as_str()),
class
]

style=move || {
Expand Down
Loading