Migrate project (Not tested yet)
This commit is contained in:
parent
c9fc2d59c6
commit
baf94d226d
2 changed files with 34 additions and 1 deletions
|
@ -8,4 +8,7 @@ mod social_link;
|
||||||
pub use social_link::{SocialLinkContainer, SocialLink};
|
pub use social_link::{SocialLinkContainer, SocialLink};
|
||||||
|
|
||||||
mod top_component;
|
mod top_component;
|
||||||
pub use top_component::TopComponent;
|
pub use top_component::TopComponent;
|
||||||
|
|
||||||
|
mod project;
|
||||||
|
pub use project::{ProjectContainer, Project};
|
30
src/app/components/project.rs
Normal file
30
src/app/components/project.rs
Normal 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>
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue