2023-09-21 22:59:35 +08:00
|
|
|
use crate::{
|
|
|
|
components::{Demo, DemoCode},
|
|
|
|
pages::MobilePage,
|
|
|
|
};
|
2023-06-13 12:43:15 +08:00
|
|
|
use leptos::*;
|
|
|
|
use melt_ui::mobile::NavBar;
|
2023-10-04 00:11:38 +08:00
|
|
|
use prisms::highlight_str;
|
2023-06-13 12:43:15 +08:00
|
|
|
|
|
|
|
#[component]
|
2023-08-29 09:11:22 +08:00
|
|
|
pub fn NavBarPage() -> impl IntoView {
|
2023-09-21 22:59:35 +08:00
|
|
|
view! {
|
|
|
|
<div style="display: flex">
|
|
|
|
<div style="width: 896px; margin: 0 auto;">
|
|
|
|
<h1>"Navbar"</h1>
|
|
|
|
<Demo>
|
|
|
|
""
|
2023-10-08 09:28:13 +08:00
|
|
|
<DemoCode
|
|
|
|
slot
|
|
|
|
html=highlight_str!(
|
|
|
|
r#"
|
2023-10-09 10:28:22 +08:00
|
|
|
let click_text = create_rw_signal(String::from("none"));
|
|
|
|
let on_click_left = move |_| click_text.set("left".to_string());
|
|
|
|
let on_click_right = move |_| click_text.set("right".to_string());
|
|
|
|
|
|
|
|
view! {
|
|
|
|
<div style="height: 100vh; background: #f5f5f5">
|
|
|
|
<NavBar
|
|
|
|
title="Home"
|
|
|
|
left_arrow=true
|
|
|
|
left_text="back"
|
|
|
|
right_text="add"
|
2023-10-17 17:25:20 +08:00
|
|
|
on_click_left=on_click_left
|
|
|
|
on_click_right=on_click_right
|
2023-10-09 10:28:22 +08:00
|
|
|
/>
|
|
|
|
<div style="padding-top: 50px">{move || click_text.get()}</div>
|
|
|
|
</div>
|
|
|
|
}
|
2023-10-08 09:28:13 +08:00
|
|
|
"#,
|
|
|
|
"rust"
|
|
|
|
)
|
|
|
|
>
|
|
|
|
|
2023-10-04 00:11:38 +08:00
|
|
|
""
|
2023-09-21 22:59:35 +08:00
|
|
|
</DemoCode>
|
|
|
|
</Demo>
|
|
|
|
</div>
|
|
|
|
<div>
|
2023-10-08 09:28:13 +08:00
|
|
|
<MobilePage path="/melt-ui?path=/mobile/nav-bar"/>
|
2023-09-21 22:59:35 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[component]
|
|
|
|
pub fn NavBarDemoPage() -> impl IntoView {
|
2023-08-29 09:11:22 +08:00
|
|
|
let click_text = create_rw_signal(String::from("none"));
|
2023-10-09 10:28:22 +08:00
|
|
|
let on_click_left = move |_| click_text.set("left".to_string());
|
|
|
|
let on_click_right = move |_| click_text.set("right".to_string());
|
2023-06-13 12:43:15 +08:00
|
|
|
|
2023-08-29 09:11:22 +08:00
|
|
|
view! {
|
2023-06-13 12:43:15 +08:00
|
|
|
<div style="height: 100vh; background: #f5f5f5">
|
2023-10-08 09:28:13 +08:00
|
|
|
<NavBar
|
|
|
|
title="Home"
|
|
|
|
left_arrow=true
|
|
|
|
left_text="back"
|
|
|
|
right_text="add"
|
2023-10-17 17:25:20 +08:00
|
|
|
on_click_left=on_click_left
|
|
|
|
on_click_right=on_click_right
|
2023-10-08 09:28:13 +08:00
|
|
|
/>
|
|
|
|
<div style="padding-top: 50px">{move || click_text.get()}</div>
|
2023-06-13 12:43:15 +08:00
|
|
|
</div>
|
|
|
|
}
|
2023-08-29 09:11:22 +08:00
|
|
|
}
|