diff --git a/app/soapbox/components/hashtag.tsx b/app/soapbox/components/hashtag.tsx index 0b0cc5bae..41267d19c 100644 --- a/app/soapbox/components/hashtag.tsx +++ b/app/soapbox/components/hashtag.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; +import { Link } from 'react-router-dom'; import { Sparklines, SparklinesCurve } from 'react-sparklines'; import { shortNumberFormat } from '../utils/numbers'; -import Permalink from './permalink'; import { HStack, Stack, Text } from './ui'; import type { Tag } from 'soapbox/types/entities'; @@ -19,9 +19,9 @@ const Hashtag: React.FC = ({ hashtag }) => { return ( - + #{hashtag.name} - + {hashtag.history && ( diff --git a/app/soapbox/components/permalink.tsx b/app/soapbox/components/permalink.tsx deleted file mode 100644 index db68811e5..000000000 --- a/app/soapbox/components/permalink.tsx +++ /dev/null @@ -1,37 +0,0 @@ -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/features/birthdays/account.tsx b/app/soapbox/features/birthdays/account.tsx index 745ca5268..805538fd5 100644 --- a/app/soapbox/features/birthdays/account.tsx +++ b/app/soapbox/features/birthdays/account.tsx @@ -1,10 +1,10 @@ import React, { useCallback } from 'react'; import { defineMessages, useIntl } from 'react-intl'; +import { Link } from 'react-router-dom'; import Avatar from 'soapbox/components/avatar'; import DisplayName from 'soapbox/components/display-name'; import Icon from 'soapbox/components/icon'; -import Permalink from 'soapbox/components/permalink'; import { useAppSelector } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; @@ -38,13 +38,13 @@ const Account: React.FC = ({ accountId }) => { return (
- +
-
+
= ({ id }) => {
- + - +
diff --git a/app/soapbox/features/follow_requests/components/account_authorize.tsx b/app/soapbox/features/follow_requests/components/account_authorize.tsx index 0d0428d44..0c8e8a561 100644 --- a/app/soapbox/features/follow_requests/components/account_authorize.tsx +++ b/app/soapbox/features/follow_requests/components/account_authorize.tsx @@ -1,12 +1,12 @@ import React, { useCallback } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; +import { Link } from 'react-router-dom'; import { authorizeFollowRequest, rejectFollowRequest } from 'soapbox/actions/accounts'; import Avatar from 'soapbox/components/avatar'; import DisplayName from 'soapbox/components/display-name'; import IconButton from 'soapbox/components/icon_button'; -import Permalink from 'soapbox/components/permalink'; import { Text } from 'soapbox/components/ui'; import { useAppSelector } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; @@ -43,10 +43,10 @@ const AccountAuthorize: React.FC = ({ id }) => { return (
- +
-
+
diff --git a/app/soapbox/features/notifications/components/notification.tsx b/app/soapbox/features/notifications/components/notification.tsx index f9ba8de33..bd4433e8d 100644 --- a/app/soapbox/features/notifications/components/notification.tsx +++ b/app/soapbox/features/notifications/components/notification.tsx @@ -1,7 +1,7 @@ import React, { useCallback } from 'react'; import { HotKeys } from 'react-hotkeys'; import { defineMessages, useIntl, FormattedMessage, IntlShape, MessageDescriptor, defineMessage } from 'react-intl'; -import { useHistory } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import { mentionCompose } from 'soapbox/actions/compose'; import { reblog, favourite, unreblog, unfavourite } from 'soapbox/actions/interactions'; @@ -9,7 +9,6 @@ import { openModal } from 'soapbox/actions/modals'; import { getSettings } from 'soapbox/actions/settings'; import { hideStatus, revealStatus } from 'soapbox/actions/statuses'; import Icon from 'soapbox/components/icon'; -import Permalink from 'soapbox/components/permalink'; import { HStack, Text, Emoji } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account_container'; import StatusContainer from 'soapbox/containers/status_container'; @@ -30,9 +29,8 @@ const notificationForScreenReader = (intl: IntlShape, message: string, timestamp const buildLink = (account: Account): JSX.Element => ( -