Migrate social_link components

This commit is contained in:
Florian RICHER 2023-10-08 22:02:08 +02:00
parent d420097a88
commit 35d4878bb7
6 changed files with 37 additions and 48 deletions

View file

@ -2,4 +2,7 @@ mod tag;
pub use tag::Tag;
mod link;
pub use link::Link;
pub use link::Link;
mod social_link;
pub use social_link::{SocialLinkContainer, SocialLink};

View file

@ -0,0 +1,27 @@
use leptos::*;
use leptos_icons::*;
#[component]
pub fn SocialLinkContainer(
children: Children
) -> impl IntoView {
view! {
<div class="flex gap-5 justify-center flex-wrap my-5">
{ children() }
</div>
}
}
#[component]
pub fn SocialLink(
children: Children,
url: String,
icon: Icon,
) -> impl IntoView {
view! {
<a class="mx-auto scale-150 mb-1" href=url target="_blank">
<Icon icon=icon class="mx-auto scale-150 mb-1" />
<span class="text-sm">{ children() }</span>
</a>
}
}