diff --git a/app/javascript/mastodon/components/account/index.tsx b/app/javascript/mastodon/components/account/index.tsx index 5c0716412..8397695a4 100644 --- a/app/javascript/mastodon/components/account/index.tsx +++ b/app/javascript/mastodon/components/account/index.tsx @@ -3,6 +3,7 @@ import { useCallback, useMemo } from 'react'; import { defineMessages, useIntl, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; +import { Link } from 'react-router-dom'; import MoreHorizIcon from '@/material-icons/400-24px/more_horiz.svg?react'; import { @@ -24,7 +25,6 @@ import { FollowersCounter } from 'mastodon/components/counters'; import { DisplayName } from 'mastodon/components/display_name'; import { Dropdown } from 'mastodon/components/dropdown_menu'; import { FollowButton } from 'mastodon/components/follow_button'; -import { Permalink } from 'mastodon/components/permalink'; import { RelativeTimestamp } from 'mastodon/components/relative_timestamp'; import { ShortNumber } from 'mastodon/components/short_number'; import { Skeleton } from 'mastodon/components/skeleton'; @@ -293,10 +293,9 @@ export const Account: React.FC = ({ })} >
- @@ -327,7 +326,7 @@ export const Account: React.FC = ({
)} - + {account && withBio && diff --git a/app/javascript/mastodon/components/permalink.jsx b/app/javascript/mastodon/components/permalink.jsx deleted file mode 100644 index 4279efba8..000000000 --- a/app/javascript/mastodon/components/permalink.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import PropTypes from 'prop-types'; -import { PureComponent } from 'react'; - -export class Permalink extends PureComponent { - - static contextTypes = { - router: PropTypes.object, - }; - - static propTypes = { - className: PropTypes.string, - href: PropTypes.string.isRequired, - to: PropTypes.string.isRequired, - children: PropTypes.node, - onInterceptClick: PropTypes.func, - }; - - handleClick = e => { - if (this.props.onInterceptClick && this.props.onInterceptClick()) { - e.preventDefault(); - return; - } - - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { - e.preventDefault(); - this.context.router.history.push(this.props.to); - } - } - - render () { - const { href, children, className, onInterceptClick, ...other } = this.props; - - return ( - - {children} - - ); - } - -} diff --git a/app/javascript/mastodon/features/compose/components/reply_indicator.jsx b/app/javascript/mastodon/features/compose/components/reply_indicator.jsx index 4392ea772..da352589f 100644 --- a/app/javascript/mastodon/features/compose/components/reply_indicator.jsx +++ b/app/javascript/mastodon/features/compose/components/reply_indicator.jsx @@ -2,12 +2,13 @@ import { FormattedMessage } from 'react-intl'; import { useSelector } from 'react-redux'; +import { Link } from 'react-router-dom'; + import BarChart4BarsIcon from '@/material-icons/400-24px/bar_chart_4_bars.svg?react'; import PhotoLibraryIcon from '@/material-icons/400-24px/photo_library.svg?react'; import { Avatar } from 'mastodon/components/avatar'; import { DisplayName } from 'mastodon/components/display_name'; import { Icon } from 'mastodon/components/icon'; -import { Permalink } from 'mastodon/components/permalink'; import { EmbeddedStatusContent } from 'mastodon/features/notifications_v2/components/embedded_status_content'; export const ReplyIndicator = () => { @@ -23,14 +24,14 @@ export const ReplyIndicator = () => {
- + - +
- + - + ( - + - + )).reduce((prev, cur) => [prev, ', ', cur]); const handlers = { diff --git a/app/javascript/mastodon/features/directory/components/account_card.tsx b/app/javascript/mastodon/features/directory/components/account_card.tsx index 0eabf6c56..2a0470bb7 100644 --- a/app/javascript/mastodon/features/directory/components/account_card.tsx +++ b/app/javascript/mastodon/features/directory/components/account_card.tsx @@ -4,6 +4,7 @@ import { useCallback } from 'react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import classNames from 'classnames'; +import { Link } from 'react-router-dom'; import { followAccount, @@ -14,7 +15,6 @@ import { openModal } from 'mastodon/actions/modal'; import { Avatar } from 'mastodon/components/avatar'; import { Button } from 'mastodon/components/button'; import { DisplayName } from 'mastodon/components/display_name'; -import { Permalink } from 'mastodon/components/permalink'; import { ShortNumber } from 'mastodon/components/short_number'; import { autoPlayGif, me } from 'mastodon/initial_state'; import type { Account } from 'mastodon/models/account'; @@ -165,11 +165,7 @@ export const AccountCard: React.FC<{ accountId: string }> = ({ accountId }) => { return (
- +
= ({ accountId }) => {
- + {account.get('note').length > 0 && (
- +
-
+
diff --git a/app/javascript/mastodon/features/notifications/components/follow_request.jsx b/app/javascript/mastodon/features/notifications/components/follow_request.jsx index dadfb2943..4024455cb 100644 --- a/app/javascript/mastodon/features/notifications/components/follow_request.jsx +++ b/app/javascript/mastodon/features/notifications/components/follow_request.jsx @@ -2,6 +2,8 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; +import { Link } from 'react-router-dom'; + import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -10,7 +12,6 @@ import CloseIcon from '@/material-icons/400-24px/close.svg?react'; import { Avatar } from 'mastodon/components/avatar'; import { DisplayName } from 'mastodon/components/display_name'; import { IconButton } from 'mastodon/components/icon_button'; -import { Permalink } from 'mastodon/components/permalink'; const messages = defineMessages({ authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' }, @@ -45,10 +46,10 @@ class FollowRequest extends ImmutablePureComponent { return (
- +
-
+
diff --git a/app/javascript/mastodon/features/notifications/components/notification.jsx b/app/javascript/mastodon/features/notifications/components/notification.jsx index f0302e4d5..4629bb3a4 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.jsx +++ b/app/javascript/mastodon/features/notifications/components/notification.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { injectIntl, FormattedMessage, defineMessages } from 'react-intl'; import classNames from 'classnames'; -import { withRouter } from 'react-router-dom'; +import { Link, withRouter } from 'react-router-dom'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -20,7 +20,6 @@ import RepeatIcon from '@/material-icons/400-24px/repeat.svg?react'; import StarIcon from '@/material-icons/400-24px/star-fill.svg?react'; import { Account } from 'mastodon/components/account'; import { Icon } from 'mastodon/components/icon'; -import { Permalink } from 'mastodon/components/permalink'; import { StatusQuoteManager } from 'mastodon/components/status_quoted'; import { me } from 'mastodon/initial_state'; import { WithRouterPropTypes } from 'mastodon/utils/react_router'; @@ -436,7 +435,7 @@ class Notification extends ImmutablePureComponent { const targetAccount = report.get('target_account'); const targetDisplayNameHtml = { __html: targetAccount.get('display_name_html') }; - const targetLink = ; + const targetLink = ; return ( @@ -459,7 +458,7 @@ class Notification extends ImmutablePureComponent { const { notification } = this.props; const account = notification.get('account'); const displayNameHtml = { __html: account.get('display_name_html') }; - const link = ; + const link = ; switch(notification.get('type')) { case 'follow': diff --git a/app/javascript/mastodon/features/status/components/detailed_status.tsx b/app/javascript/mastodon/features/status/components/detailed_status.tsx index 272547483..27aef300f 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.tsx +++ b/app/javascript/mastodon/features/status/components/detailed_status.tsx @@ -24,7 +24,6 @@ import { getHashtagBarForStatus } from 'mastodon/components/hashtag_bar'; import { Icon } from 'mastodon/components/icon'; import { IconLogo } from 'mastodon/components/logo'; import MediaGallery from 'mastodon/components/media_gallery'; -import { Permalink } from 'mastodon/components/permalink'; import { PictureInPicturePlaceholder } from 'mastodon/components/picture_in_picture_placeholder'; import StatusContent from 'mastodon/components/status_content'; import { QuotedStatus } from 'mastodon/components/status_quoted'; @@ -332,9 +331,8 @@ export const DetailedStatus: React.FC<{ />
)} - @@ -352,7 +350,7 @@ export const DetailedStatus: React.FC<{ )} - + {matchedFilters && (