Migrate top_component.rs components

This commit is contained in:
Florian RICHER 2023-10-08 22:26:04 +02:00
parent 35d4878bb7
commit c9fc2d59c6
7 changed files with 43 additions and 102 deletions

View file

@ -3,8 +3,6 @@ mod components;
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
use leptos_icons::FaIcon::FaGithubBrands;
use leptos_icons::*;
#[component]
pub fn App() -> impl IntoView {
@ -23,30 +21,9 @@ pub fn App() -> impl IntoView {
#[component]
fn Home() -> impl IntoView {
let (count, set_count) = create_signal(0);
view! {
<main class="my-0 mx-auto max-w-3xl text-center">
<h2 class="p-6 text-4xl">"Welcome to Leptos with Tailwind"</h2>
<p class="px-10 pb-10 text-left">"Tailwind will scan your Rust files for Tailwind class names and compile them into a CSS file."</p>
<components::Tag>Salut</components::Tag>
<components::Link>Salut</components::Link>
<components::SocialLinkContainer>
<components::SocialLink icon=Icon::from(FaGithubBrands) url="https://github.com/mrdev023".to_string()>Github</components::SocialLink>
<components::SocialLink icon=Icon::from(FaGithubBrands) url="https://github.com/mrdev023".to_string()>Github</components::SocialLink>
</components::SocialLinkContainer>
<button
class="bg-amber-600 hover:bg-sky-700 px-5 py-3 text-white rounded-lg"
on:click=move |_| set_count.update(|count| *count += 1)
>
"Something's here | "
{move || if count() == 0 {
"Click me!".to_string()
} else {
count().to_string()
}}
" | Some more text"
</button>
<main class="m-0 p-0 bg-surface dark:bg-dark_surface text-on_surface dark:text-dark_on_surface">
<components::TopComponent/>
</main>
}
}