Skip to content

Commit

Permalink
Fix issue with redirect when we go out of website
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Nov 19, 2023
1 parent 850ddae commit cf80b87
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/components/ListBlogItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import ListGroup from "react-bootstrap/ListGroup";
import Image from "react-bootstrap/Image";
import { Row, Col, Badge, Stack } from "react-bootstrap";

function listBlogItem(props) {
const redirect = (p) => {
window.open(`#${p.link}`, "_blank");
};

return (
<ListGroup.Item
action
onClick={() => redirect(props)}
key={props.title}
className="mt-3"
>
<Row description="horizontal" gap={3}>
<Col xs={6} md={2}>
<Image src={props.image} rounded fluid />
</Col>
<Col xs={6} md={10} className="d-flex flex-column align-self-center">
<h4 className="font-title">{props.title}</h4>
<h6 className="font-description">{props.description}</h6>
<Stack direction="horizontal" gap={2} className="mt-2">
{props.tags && props.tags.map((tag, idx) => {
return (
<Badge bg="primary" key={idx}>
{tag}
</Badge>
);
})}
</Stack>
</Col>
</Row>
</ListGroup.Item>
);
}

export default listBlogItem;

0 comments on commit cf80b87

Please sign in to comment.