Skip to content

Commit

Permalink
Hide posts with devhub-test tag from feed
Browse files Browse the repository at this point in the history
  • Loading branch information
itexpert120 committed Nov 16, 2023
1 parent 4324a9c commit 601c3d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/devhub/entity/post/List.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function defaultRenderItem(postId, additionalProps) {
}
// It is important to have a non-zero-height element as otherwise InfiniteScroll loads too many items on initial load
return (
<div className="py-2" style={{ minHeight: "150px" }}>
<div style={{ minHeight: "auto" }}>
<Widget
src={"${REPL_DEVHUB}/widget/devhub.entity.post.Post"}
props={{
Expand All @@ -153,6 +153,8 @@ function defaultRenderItem(postId, additionalProps) {
onDraftStateChange,
...additionalProps,
referral: postId,
hideTestPost: props.tag !== "devhub-test",
fromFeed,
}}
/>
</div>
Expand Down Expand Up @@ -316,7 +318,7 @@ const fetchMore =
));

const items = state.items ? state.items.slice(0, state.displayCount) : [];

console.log("items", items);
const renderedItems = items.map(cachedRenderItem);

const Head =
Expand Down
8 changes: 7 additions & 1 deletion src/devhub/entity/post/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,13 @@ const CardContainer = styled.div`
`;

return (
<CardContainer className={`card ${borders[snapshot.post_type]} attractable`}>
<CardContainer
className={`card my-3 ${borders[snapshot.post_type]} ${
props.hideTestPost && post.snapshot.labels.includes("devhub-test")
? "d-none"
: ""
}`}
>
{header}
<div className="card-body" style={{ padding: 0 }}>
{searchKeywords}
Expand Down

0 comments on commit 601c3d6

Please sign in to comment.