mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-03-20 11:48:31 -04: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:
66
frontend/src/static/js/pages/ProfileLikedPage.js
Executable file
66
frontend/src/static/js/pages/ProfileLikedPage.js
Executable file
@@ -0,0 +1,66 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ApiUrlConsumer } from '../utils/contexts/';
|
||||
import { PageStore } from '../utils/stores/';
|
||||
import { MediaListWrapper } from '../components/MediaListWrapper';
|
||||
import ProfilePagesHeader from '../components/profile-page/ProfilePagesHeader';
|
||||
import ProfilePagesContent from '../components/profile-page/ProfilePagesContent';
|
||||
import { LazyLoadItemListAsync } from '../components/item-list/LazyLoadItemListAsync';
|
||||
import { ProfileMediaPage } from './ProfileMediaPage';
|
||||
|
||||
export class ProfileLikedPage extends ProfileMediaPage {
|
||||
constructor(props) {
|
||||
super(props, 'author-liked');
|
||||
|
||||
this.state = {
|
||||
resultsCount: null,
|
||||
};
|
||||
|
||||
this.getCountFunc = this.getCountFunc.bind(this);
|
||||
}
|
||||
|
||||
getCountFunc(resultsCount) {
|
||||
this.setState({
|
||||
resultsCount: resultsCount,
|
||||
});
|
||||
}
|
||||
|
||||
pageContent() {
|
||||
return [
|
||||
this.state.author ? (
|
||||
<ProfilePagesHeader key="ProfilePagesHeader" author={this.state.author} type="liked" />
|
||||
) : null,
|
||||
this.state.author ? (
|
||||
<ProfilePagesContent key="ProfilePagesContent">
|
||||
<ApiUrlConsumer>
|
||||
{(apiUrl) => (
|
||||
<MediaListWrapper
|
||||
title={
|
||||
this.props.title + (null !== this.state.resultsCount ? ' (' + this.state.resultsCount + ')' : '')
|
||||
}
|
||||
className="items-list-ver"
|
||||
>
|
||||
<LazyLoadItemListAsync
|
||||
itemsCountCallback={this.getCountFunc}
|
||||
requestUrl={apiUrl.user.liked}
|
||||
hideAuthor={!PageStore.get('config-media-item').displayAuthor}
|
||||
hideViews={!PageStore.get('config-media-item').displayViews}
|
||||
hideDate={!PageStore.get('config-media-item').displayPublishDate}
|
||||
canEdit={false}
|
||||
/>
|
||||
</MediaListWrapper>
|
||||
)}
|
||||
</ApiUrlConsumer>
|
||||
</ProfilePagesContent>
|
||||
) : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
ProfileLikedPage.propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
ProfileLikedPage.defaultProps = {
|
||||
title: 'Liked media',
|
||||
};
|
||||
Reference in New Issue
Block a user