Migrate project (Not tested yet)

This commit is contained in:
Florian RICHER 2023-10-09 14:05:42 +02:00
parent c9fc2d59c6
commit baf94d226d
No known key found for this signature in database
GPG key ID: 6BF27BF8A1E71623
2 changed files with 34 additions and 1 deletions

View file

@ -8,4 +8,7 @@ mod social_link;
pub use social_link::{SocialLinkContainer, SocialLink};
mod top_component;
pub use top_component::TopComponent;
pub use top_component::TopComponent;
mod project;
pub use project::{ProjectContainer, Project};

View file

@ -0,0 +1,30 @@
use leptos::*;
#[component]
pub fn ProjectContainer(
children: Children
) -> impl IntoView {
view! {
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 mt-3">
{ children() }
</div>
}
}
#[component]
pub fn Project(
children: Children,
image_src: String,
url: String
) -> impl IntoView {
view! {
<a href=url target="_blank" class="rounded-lg p-5 flex flex-col items-center gap-2 bg-primary/10 dark:bg-dark_primary/10 shadow-md shadow-primary/5 dark:shadow-dark_primary/5 hover:bg-primary/20 hover:dark:bg-dark_primary/20 hover:shadow-md hover:shadow-primary/10 hover:dark:shadow-dark_primary/10">
{ if !image_src.is_empty() {
Some(view! { <img src=image_src class="h-1/2"/> })
} else {
None
}}
<div class="flex flex-col justify-center h-full"><p>{children()}</p></div>
</a>
}
}