~vpzom/hitide

5e302b81be25f00635cea654f2c0ee9bac97a8ae — Colin Reeder 1 year, 2 months ago d8bcc40
Show "View More Comments" when tree hits limit (#13)
2 files changed, 13 insertions(+), 4 deletions(-)

M src/components/mod.rs
M src/resp_types.rs
M src/components/mod.rs => src/components/mod.rs +12 -4
@@ 54,8 54,7 @@ pub fn Comment<'comment, 'base_data>(
            </div>

            {
                match &comment.replies {
                    Some(replies) => {
                if let Some(replies) = &comment.replies {
                        Some(render::rsx! {
                            <ul>
                                {


@@ 68,8 67,17 @@ pub fn Comment<'comment, 'base_data>(
                                }
                            </ul>
                        })
                    },
                    None => None,
                } else {
                    None
                }
            }
            {
                if comment.replies.is_none() && comment.has_replies {
                    Some(render::rsx! {
                        <ul><li><a href={format!("/comments/{}", comment.id)}>{"-> View More Comments"}</a></li></ul>
                    })
                } else {
                    None
                }
            }
        </li>

M src/resp_types.rs => src/resp_types.rs +1 -0
@@ 34,6 34,7 @@ pub struct RespPostCommentInfo<'a> {
    pub your_vote: Option<Empty>,
    #[serde(borrow)]
    pub replies: Option<Vec<RespPostCommentInfo<'a>>>,
    pub has_replies: bool,
}

#[derive(Deserialize, Debug)]