Skip to content

Commit

Permalink
Update Leptos book examples
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielleHuisman committed Jan 5, 2025
1 parent d79eb8e commit 4b67a9b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions book-examples/leptos/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ console_error_panic_hook.workspace = true
console_log.workspace = true
leptos = { workspace = true, features = ["csr"] }
log.workspace = true
# radix-leptos-aspect-ratio = { path = "../../../packages/primitives/leptos/aspect-ratio", optional = true }
radix-leptos-aspect-ratio = { path = "../../../packages/primitives/leptos/aspect-ratio", optional = true }
# radix-leptos-avatar = { path = "../../../packages/primitives/leptos/avatar", optional = true }
# radix-leptos-checkbox = { path = "../../../packages/primitives/leptos/checkbox", optional = true }
# radix-leptos-icons = { path = "../../../packages/icons/leptos", optional = true }
Expand All @@ -35,15 +35,14 @@ default = [
"switch",
"toggle",
]
aspect-ratio = []
aspect-ratio = ["dep:radix-leptos-aspect-ratio"]
avatar = []
checkbox = []
label = ["dep:radix-leptos-label"]
progress = []
separator = []
switch = []
toggle = []
# aspect-ratio = ["dep:radix-leptos-aspect-ratio"]
# avatar = ["dep:radix-leptos-avatar"]
# checkbox = ["dep:radix-leptos-checkbox", "dep:radix-leptos-icons"]
# progress = ["dep:radix-leptos-progress"]
Expand Down
17 changes: 10 additions & 7 deletions book-examples/leptos/primitives/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ use leptos::prelude::*;
pub fn App() -> impl IntoView {
let mut views: Vec<AnyView> = vec![];

// #[cfg(feature = "aspect-ratio")]
// {
// use crate::aspect_ratio::AspectRatioDemo;
// views.push(view! {
// <AspectRatioDemo />
// });
// }
#[cfg(feature = "aspect-ratio")]
{
use crate::aspect_ratio::AspectRatioDemo;
views.push(
view! {
<AspectRatioDemo />
}
.into_any(),
);
}
// #[cfg(feature = "avatar")]
// {
// use crate::avatar::AvatarDemo;
Expand Down
2 changes: 1 addition & 1 deletion book-examples/leptos/primitives/src/aspect_ratio.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use leptos::*;
use leptos::prelude::*;
use radix_leptos_aspect_ratio::*;

#[component]
Expand Down
4 changes: 2 additions & 2 deletions book-examples/leptos/primitives/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod app;

// #[cfg(feature = "aspect-ratio")]
// mod aspect_ratio;
#[cfg(feature = "aspect-ratio")]
mod aspect_ratio;
// #[cfg(feature = "avatar")]
// mod avatar;
// #[cfg(feature = "checkbox")]
Expand Down
7 changes: 3 additions & 4 deletions book/src/primitives/components/aspect-ratio.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ Contains the content you want to constrain to a given ratio.
{{#tabs global="framework" }}
{{#tab name="Leptos" }}

| Prop | Type | Default |
| ---------- | ----------------- | ------- |
| `as_child` | `MaybeProp<bool>` | `false` |
| `ratio` | `MaybeProp<f64>` | `1.0` |
| Prop | Type | Default |
| ------- | ---------------- | ------- |
| `ratio` | `MaybeProp<f64>` | `1.0` |

{{#endtab }}
{{#tab name="Yew" }}
Expand Down
1 change: 0 additions & 1 deletion book/src/primitives/components/label.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Contains the content for the label.

| Prop | Type | Default |
| --------------- | ------------------------------ | ------- |
| `as_child` | `MaybeProp<bool>` | `false` |
| `on_mouse_down` | `Option<Callback<MouseEvent>>` | - |

{{#endtab }}
Expand Down

0 comments on commit 4b67a9b

Please sign in to comment.