Skip to content

Commit

Permalink
fix: Add image credit string (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmsmith authored Dec 5, 2018
1 parent 2788551 commit 9293d28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/CoverPhoto/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ A cover photo.
headline="Gene Block starts meme factory"
authors="Tanner Walters"
imageURL="https://features.dailybruin.com/2017/close-to-home/img/web.enterprise.anonymous.DLee.jpg"
imageCredit="Richard Yang/Daily Bruin"
xPosition="end"
yPosition="center"
explainer="This is an example cover photo and explainer text for Lux. Explainer text is typically a couple of sentences long and gives the reader a sense of what the article is about."
Expand Down
10 changes: 10 additions & 0 deletions src/components/CoverPhoto/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum YPosition {
interface CoverPhotoProps {
headline: string
imageURL: string
imageCredit: string
authors: string[]
xPosition: XPosition
yPosition: YPosition
Expand Down Expand Up @@ -85,6 +86,15 @@ export default class CoverPhoto extends React.Component<CoverPhotoProps> {
<Byline authors={this.props.authors} />
{!!this.props.explainer && <p>{this.props.explainer}</p>}
</div>
<span
className={css`
position: absolute;
bottom: 1rem;
right: 1rem;
`}
>
{this.props.imageCredit}
</span>
</div>
)
}
Expand Down

0 comments on commit 9293d28

Please sign in to comment.