forked from tanner/qotnews
parent
b23e470317
commit
b80c1a5cb5
6 changed files with 51 additions and 56 deletions
@ -0,0 +1,34 @@ |
||||
import React from "react"; |
||||
import { Link } from "react-router-dom"; |
||||
import { sourceLink, infoLine, getLogoUrl } from "../utils.js"; |
||||
|
||||
export class StoryItem extends React.Component { |
||||
constructor(props) { |
||||
super(props); |
||||
} |
||||
|
||||
render() { |
||||
const story = this.props.story; |
||||
const { id, title } = story; |
||||
|
||||
return ( |
||||
<div className="item" key={id}> |
||||
<div className="title"> |
||||
<Link className="link" to={"/" + id}> |
||||
<img |
||||
className="source-logo" |
||||
src={getLogoUrl(story)} |
||||
alt="source logo" |
||||
/> |
||||
{" "} |
||||
{title} |
||||
</Link> |
||||
|
||||
<span className="source">({sourceLink(story)})</span> |
||||
</div> |
||||
|
||||
{infoLine(story)} |
||||
</div> |
||||
); |
||||
} |
||||
} |
Loading…
Reference in new issue