mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
Added linkfy lib to handle messages links
This commit is contained in:
14
frontend/src/components/LinkifyWithTargetBlank/index.js
Normal file
14
frontend/src/components/LinkifyWithTargetBlank/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from "react";
|
||||
import Linkify from "react-linkify";
|
||||
|
||||
const componentDecorator = (href, text, key) => (
|
||||
<a href={href} key={key} target="_blank" rel="noopener noreferrer">
|
||||
{text}
|
||||
</a>
|
||||
);
|
||||
|
||||
const LinkifyWithTargetBlank = ({ children }) => {
|
||||
return <Linkify componentDecorator={componentDecorator}>{children}</Linkify>;
|
||||
};
|
||||
|
||||
export default LinkifyWithTargetBlank;
|
||||
Reference in New Issue
Block a user