From 35d4878bb7308f1e9a32509f71719c79df522016 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sun, 8 Oct 2023 22:02:08 +0200 Subject: [PATCH] Migrate social_link components --- src/app/components/mod.rs | 5 +++- src/app/components/social_link.rs | 27 +++++++++++++++++++ src/app/mod.rs | 6 +++++ src_old/components/social_link/SocialLink.tsx | 18 ------------- .../components/social_link/SocialLinks.scss | 13 --------- .../components/social_link/SocialLinks.tsx | 16 ----------- 6 files changed, 37 insertions(+), 48 deletions(-) create mode 100644 src/app/components/social_link.rs delete mode 100644 src_old/components/social_link/SocialLink.tsx delete mode 100644 src_old/components/social_link/SocialLinks.scss delete mode 100644 src_old/components/social_link/SocialLinks.tsx diff --git a/src/app/components/mod.rs b/src/app/components/mod.rs index c9b9c5b..26b01fd 100644 --- a/src/app/components/mod.rs +++ b/src/app/components/mod.rs @@ -2,4 +2,7 @@ mod tag; pub use tag::Tag; mod link; -pub use link::Link; \ No newline at end of file +pub use link::Link; + +mod social_link; +pub use social_link::{SocialLinkContainer, SocialLink}; \ No newline at end of file diff --git a/src/app/components/social_link.rs b/src/app/components/social_link.rs new file mode 100644 index 0000000..3dc46c6 --- /dev/null +++ b/src/app/components/social_link.rs @@ -0,0 +1,27 @@ +use leptos::*; +use leptos_icons::*; + +#[component] +pub fn SocialLinkContainer( + children: Children +) -> impl IntoView { + view! { +
+ { children() } +
+ } +} + +#[component] +pub fn SocialLink( + children: Children, + url: String, + icon: Icon, +) -> impl IntoView { + view! { + + + { children() } + + } +} \ No newline at end of file diff --git a/src/app/mod.rs b/src/app/mod.rs index 4cfb426..713ff72 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -3,6 +3,8 @@ mod components; use leptos::*; use leptos_meta::*; use leptos_router::*; +use leptos_icons::FaIcon::FaGithubBrands; +use leptos_icons::*; #[component] pub fn App() -> impl IntoView { @@ -29,6 +31,10 @@ fn Home() -> impl IntoView {

"Tailwind will scan your Rust files for Tailwind class names and compile them into a CSS file."

Salut Salut + + Github + Github +