* make feed image consistent with cover image
* small tweaks for the logged out view of the feed cover image`
* update feed cover image for logged in users
* update to reflect new cover image
* reverting to see if the build, builds?
* snapshot tests
* update spec to look for the right class
* too long by ONE character 121/120 🙄
* Update app/javascript/articles/components/ArticleCoverImage.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/articles/_single_story.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/articles/_single_story.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* no need for the anchor tag to have a bg color
* update snapshot test expectations
* remove unnecessary span with hidden class
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
31 lines
851 B
JavaScript
31 lines
851 B
JavaScript
import { h } from 'preact';
|
|
import { articlePropTypes } from '../../common-prop-types';
|
|
|
|
export const ArticleCoverImage = ({ article }) => {
|
|
return (
|
|
<div className="crayons-article__cover crayons-article__cover__image__feed">
|
|
<a
|
|
href={article.path}
|
|
className="crayons-article__cover__image__feed crayons-story__cover__image"
|
|
title={article.title}
|
|
>
|
|
<img
|
|
className="crayons-article__cover__image__feed"
|
|
src={article.main_image}
|
|
width="650"
|
|
height="275"
|
|
alt={article.title}
|
|
style={{
|
|
backgroundColor: `${article.main_image_background_hex_color}`,
|
|
}}
|
|
/>
|
|
</a>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
ArticleCoverImage.propTypes = {
|
|
article: articlePropTypes.isRequired,
|
|
};
|
|
|
|
ArticleCoverImage.displayName = 'ArticleCoverImage';
|