+
+ );
+};
-}
+Story.propTypes = {
+ url: PropTypes.string,
+ title: PropTypes.string,
+ lang: PropTypes.string,
+ publisher: PropTypes.string,
+ publishedAt: PropTypes.string,
+ author: PropTypes.string,
+ authorAccount: PropTypes.string,
+ sharedTimes: PropTypes.number,
+ thumbnail: PropTypes.string,
+ thumbnailDescription: PropTypes.string,
+ blurhash: PropTypes.string,
+ expanded: PropTypes.bool,
+};
diff --git a/app/javascript/mastodon/features/explore/links.jsx b/app/javascript/mastodon/features/explore/links.jsx
index 9e143b450..93fd1fb6d 100644
--- a/app/javascript/mastodon/features/explore/links.jsx
+++ b/app/javascript/mastodon/features/explore/links.jsx
@@ -13,7 +13,7 @@ import { DismissableBanner } from 'mastodon/components/dismissable_banner';
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';
-import Story from './components/story';
+import { Story } from './components/story';
const mapStateToProps = state => ({
links: state.getIn(['trends', 'links', 'items']),
@@ -75,6 +75,7 @@ class Links extends PureComponent {
publisher={link.get('provider_name')}
publishedAt={link.get('published_at')}
author={link.get('author_name')}
+ authorAccount={link.getIn(['author_account', 'id'])}
sharedTimes={link.getIn(['history', 0, 'accounts']) * 1 + link.getIn(['history', 1, 'accounts']) * 1}
thumbnail={link.get('image')}
thumbnailDescription={link.get('image_description')}
diff --git a/app/javascript/mastodon/features/status/components/card.jsx b/app/javascript/mastodon/features/status/components/card.jsx
index c2f5703b3..f562e53f0 100644
--- a/app/javascript/mastodon/features/status/components/card.jsx
+++ b/app/javascript/mastodon/features/status/components/card.jsx
@@ -6,7 +6,6 @@ import { PureComponent } from 'react';
import { FormattedMessage } from 'react-intl';
import classNames from 'classnames';
-import { Link } from 'react-router-dom';
import Immutable from 'immutable';
@@ -15,9 +14,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import DescriptionIcon from '@/material-icons/400-24px/description-fill.svg?react';
import OpenInNewIcon from '@/material-icons/400-24px/open_in_new.svg?react';
import PlayArrowIcon from '@/material-icons/400-24px/play_arrow-fill.svg?react';
-import { Avatar } from 'mastodon/components/avatar';
import { Blurhash } from 'mastodon/components/blurhash';
import { Icon } from 'mastodon/components/icon';
+import { MoreFromAuthor } from 'mastodon/components/more_from_author';
import { RelativeTimestamp } from 'mastodon/components/relative_timestamp';
import { useBlurhash } from 'mastodon/initial_state';
@@ -59,20 +58,6 @@ const addAutoPlay = html => {
return html;
};
-const MoreFromAuthor = ({ author }) => (
-
-
-
-
{author.get('display_name')} }} />
-
-);
-
-MoreFromAuthor.propTypes = {
- author: ImmutablePropTypes.map,
-};
-
export default class Card extends PureComponent {
static propTypes = {
@@ -259,7 +244,7 @@ export default class Card extends PureComponent {
{description}
- {showAuthor &&
}
+ {showAuthor &&
}
>
);
}
diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json
index 63298d59e..4f5caeb6a 100644
--- a/app/javascript/mastodon/locales/en.json
+++ b/app/javascript/mastodon/locales/en.json
@@ -415,6 +415,7 @@
"limited_account_hint.title": "This profile has been hidden by the moderators of {domain}.",
"link_preview.author": "By {name}",
"link_preview.more_from_author": "More from {name}",
+ "link_preview.shares": "{count, plural, one {{counter} post} other {{counter} posts}}",
"lists.account.add": "Add to list",
"lists.account.remove": "Remove from list",
"lists.delete": "Delete list",
diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss
index 2400f319d..d5c3d2605 100644
--- a/app/javascript/styles/mastodon/components.scss
+++ b/app/javascript/styles/mastodon/components.scss
@@ -8796,43 +8796,80 @@ noscript {
display: flex;
align-items: center;
color: $primary-text-color;
- text-decoration: none;
- padding: 15px;
+ padding: 16px;
border-bottom: 1px solid var(--background-border-color);
- gap: 15px;
+ gap: 16px;
&:last-child {
border-bottom: 0;
}
- &:hover,
- &:active,
- &:focus {
- color: $highlight-text-color;
-
- .story__details__publisher,
- .story__details__shared {
- color: $highlight-text-color;
- }
- }
-
&__details {
flex: 1 1 auto;
&__publisher {
color: $darker-text-color;
margin-bottom: 8px;
+ font-size: 14px;
+ line-height: 20px;
}
&__title {
+ display: block;
font-size: 19px;
line-height: 24px;
font-weight: 500;
margin-bottom: 8px;
+ text-decoration: none;
+ color: $primary-text-color;
+
+ &:hover,
+ &:active,
+ &:focus {
+ color: $highlight-text-color;
+ }
}
&__shared {
+ display: flex;
+ align-items: center;
color: $darker-text-color;
+ gap: 8px;
+ justify-content: space-between;
+ font-size: 14px;
+ line-height: 20px;
+
+ & > span {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ }
+
+ &__pill {
+ background: var(--surface-variant-background-color);
+ border-radius: 4px;
+ color: inherit;
+ text-decoration: none;
+ padding: 4px 12px;
+ font-size: 12px;
+ font-weight: 500;
+ line-height: 16px;
+ }
+
+ &__author-link {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ color: $primary-text-color;
+ font-weight: 500;
+ text-decoration: none;
+
+ &:hover,
+ &:active,
+ &:focus {
+ color: $highlight-text-color;
+ }
+ }
}
strong {
@@ -9903,14 +9940,14 @@ noscript {
color: inherit;
text-decoration: none;
padding: 4px 12px;
- background: $ui-base-color;
+ background: var(--surface-variant-background-color);
border-radius: 4px;
font-weight: 500;
&:hover,
&:focus,
&:active {
- background: lighten($ui-base-color, 4%);
+ background: var(--surface-variant-active-background-color);
}
}
diff --git a/app/javascript/styles/mastodon/variables.scss b/app/javascript/styles/mastodon/variables.scss
index 58b9dd9b6..2848a42b3 100644
--- a/app/javascript/styles/mastodon/variables.scss
+++ b/app/javascript/styles/mastodon/variables.scss
@@ -106,4 +106,6 @@ $font-monospace: 'mastodon-font-monospace' !default;
--background-color: #{darken($ui-base-color, 8%)};
--background-color-tint: #{rgba(darken($ui-base-color, 8%), 0.9)};
--surface-background-color: #{darken($ui-base-color, 4%)};
+ --surface-variant-background-color: #{$ui-base-color};
+ --surface-variant-active-background-color: #{lighten($ui-base-color, 4%)};
}