From baf94d226d2f7a1ca9b94ad3a26fd4ae0b4fbb6c Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Mon, 9 Oct 2023 14:05:42 +0200 Subject: [PATCH] Migrate project (Not tested yet) --- src/app/components/mod.rs | 5 ++++- src/app/components/project.rs | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/app/components/project.rs diff --git a/src/app/components/mod.rs b/src/app/components/mod.rs index e03464d..f38c67e 100644 --- a/src/app/components/mod.rs +++ b/src/app/components/mod.rs @@ -8,4 +8,7 @@ mod social_link; pub use social_link::{SocialLinkContainer, SocialLink}; mod top_component; -pub use top_component::TopComponent; \ No newline at end of file +pub use top_component::TopComponent; + +mod project; +pub use project::{ProjectContainer, Project}; \ No newline at end of file diff --git a/src/app/components/project.rs b/src/app/components/project.rs new file mode 100644 index 0000000..3b61e9a --- /dev/null +++ b/src/app/components/project.rs @@ -0,0 +1,30 @@ +use leptos::*; + +#[component] +pub fn ProjectContainer( + children: Children +) -> impl IntoView { + view! { +
+ { children() } +
+ } +} + +#[component] +pub fn Project( + children: Children, + image_src: String, + url: String +) -> impl IntoView { + view! { + + { if !image_src.is_empty() { + Some(view! { }) + } else { + None + }} +

{children()}

+
+ } +} \ No newline at end of file