diff --git a/app/soapbox/components/permalink.js b/app/soapbox/components/permalink.js deleted file mode 100644 index 5bae087ac1..0000000000 Binary files a/app/soapbox/components/permalink.js and /dev/null differ diff --git a/app/soapbox/components/permalink.tsx b/app/soapbox/components/permalink.tsx new file mode 100644 index 0000000000..db68811e5b --- /dev/null +++ b/app/soapbox/components/permalink.tsx @@ -0,0 +1,37 @@ +import * as React from 'react'; +import { useHistory } from 'react-router-dom'; + +interface IPermaLink extends Pick, 'dangerouslySetInnerHTML'> { + className?: string, + href: string, + title?: string, + to: string, +} + +const Permalink: React.FC = (props) => { + const history = useHistory(); + + const { className, href, title, to, children, ...filteredProps } = props; + + const handleClick = (event: React.MouseEvent) => { + if (event.button === 0 && !(event.ctrlKey || event.metaKey)) { + event.preventDefault(); + history.push(to); + } + }; + + return ( + + {children} + + ); +}; + +export default Permalink; diff --git a/app/soapbox/components/status_list.js b/app/soapbox/components/status_list.js index 65bbdba528..c8bcbb217b 100644 Binary files a/app/soapbox/components/status_list.js and b/app/soapbox/components/status_list.js differ diff --git a/app/soapbox/features/compose/components/privacy_dropdown.js b/app/soapbox/features/compose/components/privacy_dropdown.js index 415789ba50..23111ab1b6 100644 Binary files a/app/soapbox/features/compose/components/privacy_dropdown.js and b/app/soapbox/features/compose/components/privacy_dropdown.js differ