Skip to content

Commit

Permalink
fix: improve images display in some posts
Browse files Browse the repository at this point in the history
  • Loading branch information
icfor committed Dec 28, 2023
1 parent 426b05f commit 1fe5226
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/screens/blog_details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ const BlogDetails = ({ post }: Props) => {
imgEl.addEventListener("error", () => {
imgEl.parentNode?.removeChild(imgEl);
});

if (window.innerWidth < 600) return;

imgEl.addEventListener("click", () => {
window.open(imgEl.src, "_blank");
});
});
});
}
Expand Down
2 changes: 2 additions & 0 deletions src/screens/blog_details/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,11 @@ export const ContentBox = styled.div<any>`
}
}
img,
.kg-image-card img {
margin: auto;
object-fit: contain;
cursor: pointer;
overflow: hidden;
width: 100%;
height: 100%;
Expand Down

0 comments on commit 1fe5226

Please sign in to comment.