mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-12-16 08:32:32 -05:00
Frontent dev env (#247)
* Added frontend development files/environment * More items-categories related removals * Improvements in pages templates (inc. static pages) * Improvements in video player * Added empty home page message + cta * Updates in media, playlist and management pages * Improvements in material icons font loading * Replaced media & playlists links in frontend dev-env * frontend package version update * chnaged frontend dev url port * static files update * Changed default position of theme switcher * enabled frontend docker container
This commit is contained in:
61
frontend/src/static/js/components/media-page/ViewerInfo.js
Executable file
61
frontend/src/static/js/components/media-page/ViewerInfo.js
Executable file
@@ -0,0 +1,61 @@
|
||||
import React from 'react';
|
||||
import { MediaPageStore } from '../../utils/stores/';
|
||||
import ViewerInfoContent from './ViewerInfoContent';
|
||||
import ViewerInfoTitleBanner from './ViewerInfoTitleBanner';
|
||||
|
||||
export default class ViewerInfo extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
videoLoaded: false,
|
||||
};
|
||||
|
||||
this.onVideoLoad = this.onVideoLoad.bind(this);
|
||||
|
||||
MediaPageStore.on('loaded_media_data', this.onVideoLoad);
|
||||
}
|
||||
|
||||
onVideoLoad() {
|
||||
this.setState({
|
||||
videoLoaded: true,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
let views, categories, title, author, published, description;
|
||||
let allowDownload = false;
|
||||
|
||||
if (this.state.videoLoaded) {
|
||||
allowDownload = MediaPageStore.get('media-data').allow_download;
|
||||
|
||||
if (void 0 === allowDownload) {
|
||||
allowDownload = true;
|
||||
} else {
|
||||
allowDownload = !!allowDownload;
|
||||
}
|
||||
|
||||
views = MediaPageStore.get('media-data').views;
|
||||
categories = MediaPageStore.get('media-data').categories_info;
|
||||
title = MediaPageStore.get('media-data').title;
|
||||
|
||||
author = {
|
||||
name: MediaPageStore.get('media-data').author_name,
|
||||
url: MediaPageStore.get('media-data').author_profile,
|
||||
thumb: MediaPageStore.get('media-author-thumbnail-url'),
|
||||
};
|
||||
|
||||
published = MediaPageStore.get('media-data').add_date;
|
||||
description = MediaPageStore.get('media-data').description;
|
||||
}
|
||||
|
||||
return !this.state.videoLoaded ? null : (
|
||||
<div className="viewer-info">
|
||||
<div className="viewer-info-inner">
|
||||
<ViewerInfoTitleBanner title={title} views={views} categories={categories} allowDownload={allowDownload} />
|
||||
<ViewerInfoContent author={author} published={published} description={description} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user