import Video from '../features/video';
import Card from '../features/status/components/card';
import Poll from 'mastodon/components/poll';
+import Hashtag from 'mastodon/components/hashtag';
import ModalRoot from '../components/modal_root';
import { getScrollbarWidth } from '../features/ui/components/modal_root';
import MediaModal from '../features/ui/components/media_modal';
const { localeData, messages } = getLocale();
addLocaleData(localeData);
-const MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll };
+const MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll, Hashtag };
export default class MediaContainer extends PureComponent {
{[].map.call(components, (component, i) => {
const componentName = component.getAttribute('data-component');
const Component = MEDIA_COMPONENTS[componentName];
- const { media, card, poll, ...props } = JSON.parse(component.getAttribute('data-props'));
+ const { media, card, poll, hashtag, ...props } = JSON.parse(component.getAttribute('data-props'));
Object.assign(props, {
- ...(media ? { media: fromJS(media) } : {}),
- ...(card ? { card: fromJS(card) } : {}),
- ...(poll ? { poll: fromJS(poll) } : {}),
+ ...(media ? { media: fromJS(media) } : {}),
+ ...(card ? { card: fromJS(card) } : {}),
+ ...(poll ? { poll: fromJS(poll) } : {}),
+ ...(hashtag ? { hashtag: fromJS(hashtag) } : {}),
...(componentName === 'Video' ? {
onOpenVideo: this.handleOpenVideo,
component,
);
})}
+
<ModalRoot onClose={this.handleCloseMedia}>
{this.state.media && (
<MediaModal
.hero-widget__text
%p= @instance_presenter.site_short_description.html_safe.presence || @instance_presenter.site_description.html_safe.presence || t('about.generic_description', domain: site_hostname)
+
+- if Setting.trends
+ - trends = TrendingTags.get(3)
+
+ - unless trends.empty?
+ .endorsements-widget.trends-widget
+ %h4.emojify= t('footer.trending_now')
+
+ - trends.each do |tag|
+ = react_component :hashtag, hashtag: ActiveModelSerializers::SerializableResource.new(tag, serializer: REST::TagSerializer).as_json