-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with redirect when we go out of website
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |