-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11604 from nanaya/news-post-2x
Add 2x support for news cover image
- Loading branch information
Showing
10 changed files
with
75 additions
and
25 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
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,6 +1,7 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
import Img2x from 'components/img2x'; | ||
import StringWithComponent from 'components/string-with-component'; | ||
import PostJson from 'interfaces/news-post-json'; | ||
import { route } from 'laroute'; | ||
|
@@ -13,7 +14,7 @@ export default function PostItem({ modifiers, post }: { modifiers?: string[]; po | |
let cover; | ||
|
||
if (post.first_image != null) { | ||
cover = <img className='news-card__cover' src={post.first_image} />; | ||
cover = <Img2x className='news-card__cover' src={post.first_image} src2x={post['first_image@2x']} />; | ||
} | ||
|
||
let preview = post.preview; | ||
|
@@ -40,8 +41,8 @@ export default function PostItem({ modifiers, post }: { modifiers?: string[]; po | |
<div className='news-card__main'> | ||
<div className='news-card__row news-card__row--title'>{post.title}</div> | ||
<div | ||
dangerouslySetInnerHTML={{ __html: preview }} | ||
className='news-card__row news-card__row--preview' | ||
dangerouslySetInnerHTML={{ __html: preview }} | ||
/> | ||
<div className='news-card__row news-card__row--author'> | ||
<StringWithComponent | ||
|
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