Switch over to WebAssembly, Rust and Yew #35
@ -98,14 +98,14 @@ pub fn post_card(props: &PostCardProps) -> Html {
|
|||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
{post_card_image(&props.post.doc_info.slug, &props.post.cover_image)}
|
{post_card_image(&props.post.doc_info.slug, &props.post.cover_image)}
|
||||||
<div class="col-span-2">
|
<div class="xl:col-span-2 md:mt-4 lg:mt-0">
|
||||||
{post_card_description(&props.post, &tags)}
|
{post_card_description(&props.post, &tags)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
html! {
|
html! {
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4 md:mt-20 lg:mt-0">
|
||||||
{post_card_image(&props.post.doc_info.slug, &props.post.cover_image)}
|
{post_card_image(&props.post.doc_info.slug, &props.post.cover_image)}
|
||||||
{post_card_description(&props.post, &tags)}
|
{post_card_description(&props.post, &tags)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use yew::{function_component, html, use_context, Html, Properties};
|
use yew::{function_component, html, use_context, Html};
|
||||||
|
|
||||||
use crate::{components::blog::post_card::PostCard, model::source::PostsContext};
|
use crate::{components::blog::post_card::PostCard, model::source::PostsContext};
|
||||||
|
|
||||||
@ -7,7 +7,7 @@ pub fn post_card_list() -> Html {
|
|||||||
let posts = use_context::<PostsContext>().expect("PostsContext to be provided");
|
let posts = use_context::<PostsContext>().expect("PostsContext to be provided");
|
||||||
|
|
||||||
html! {
|
html! {
|
||||||
<div class="grid grid-cols-3 gap-x-10 gap-y-20 my-10">
|
<div class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-x-10 lg:gap-y-20 my-10">
|
||||||
{for posts.iter().enumerate().map(|(index, post)| {
|
{for posts.iter().enumerate().map(|(index, post)| {
|
||||||
html! {
|
html! {
|
||||||
<PostCard post={post.clone()} first={index == 0} />
|
<PostCard post={post.clone()} first={index == 0} />
|
||||||
|
Loading…
Reference in New Issue
Block a user