This repository has been archived by the owner on Aug 16, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove clamp - serious performance hit in Firefox and Edge * Rough styles and layout * Fix position * Shouldn't be absolute * Clean * New post preview design
- Loading branch information
1 parent
e9ea574
commit 1bbd437
Showing
9 changed files
with
197 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.PostPage__post { | ||
display: none; | ||
padding-top: 0!important; | ||
&.showPost { | ||
display: block; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.postsLayout { | ||
display: flex; | ||
flex-wrap: wrap; | ||
&__post { | ||
width: 100%; | ||
padding: 10px; | ||
@media (min-width: 768px) { | ||
width: 50%; | ||
} | ||
.PostPreviewBackdrop { | ||
height: 200px; | ||
background-size: cover; | ||
} | ||
.PostPreviewBody { | ||
background: #fff; | ||
padding: 20px; | ||
margin-top: -25px; | ||
width: 95%; | ||
float: right; | ||
} | ||
} | ||
} | ||
|
||
.postsContainer { | ||
margin-left: -10px; | ||
margin-right: -10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import _ from 'lodash'; | ||
import { connect } from 'react-redux'; | ||
|
||
import Post from './PostPreview'; | ||
|
||
class NewPostsContainer extends React.Component { | ||
static propTypes = { | ||
post: PropTypes.shape().isRequired, | ||
}; | ||
render() { | ||
const { post } = this.props; | ||
const { media } = post; | ||
let { title } = media; | ||
let mediaUrl = `/${media.type}/${media.tmdbid}`; | ||
if (media.seasonNum) { | ||
title += ` S${media.seasonNum}`; | ||
mediaUrl += `/season/${media.seasonNum}`; | ||
if (media.episodeNum) { | ||
title += ` E${media.episodeNum}`; | ||
mediaUrl += `/episode/${media.episodeNum}`; | ||
} | ||
} | ||
const poster = media.episodePath || media.backdropPath || ''; | ||
return ( | ||
<div className="postsLayout__post"> | ||
<Post | ||
overview={post.body} | ||
id={post.id} | ||
title={post.title} | ||
permlink={post.permlink} | ||
posterPath={poster} | ||
mediaTitle={title} | ||
author={post.author} | ||
url={`/${post.url}`} | ||
mediaUrl={mediaUrl} | ||
handleLikeClick={this.handleLikeClick} | ||
post={post} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = (state, ownProps) => ({ | ||
post: _.get(state, `posts.items[${ownProps.postId}]`, {}), | ||
}); | ||
|
||
export default connect(mapStateToProps, null)(NewPostsContainer); |
Oops, something went wrong.