diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-08-18 14:55:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-18 14:55:32 +0200 |
commit | c6b4b923e6f88b7cc4a1af251cb532a5a15035e2 (patch) | |
tree | 319ffb60377d37f3f22bc9ded64fba75522339f5 /app/javascript | |
parent | 96702e7f6727d9c688b2c6e2527c4a5bfefff886 (diff) |
Add trends to public pages sidebar (#11594)
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/containers/media_container.js | 13 | ||||
-rw-r--r-- | app/javascript/styles/mastodon/widgets.scss | 10 |
2 files changed, 18 insertions, 5 deletions
diff --git a/app/javascript/mastodon/containers/media_container.js b/app/javascript/mastodon/containers/media_container.js index 48492f43d..8fddb6f54 100644 --- a/app/javascript/mastodon/containers/media_container.js +++ b/app/javascript/mastodon/containers/media_container.js @@ -7,6 +7,7 @@ import MediaGallery from '../components/media_gallery'; 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'; @@ -15,7 +16,7 @@ import { List as ImmutableList, fromJS } from 'immutable'; 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 { @@ -62,12 +63,13 @@ 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, @@ -81,6 +83,7 @@ export default class MediaContainer extends PureComponent { component, ); })} + <ModalRoot onClose={this.handleCloseMedia}> {this.state.media && ( <MediaModal diff --git a/app/javascript/styles/mastodon/widgets.scss b/app/javascript/styles/mastodon/widgets.scss index b0d2d1787..04beb869c 100644 --- a/app/javascript/styles/mastodon/widgets.scss +++ b/app/javascript/styles/mastodon/widgets.scss @@ -100,6 +100,16 @@ background-size: 44px 44px; } } + + .trends__item { + padding: 10px; + } +} + +.trends-widget { + h4 { + color: $darker-text-color; + } } .box-widget { |