Skip to content

Commit

Permalink
3208: Simplified media-section
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Dec 15, 2024
1 parent dfbc91b commit d51d094
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
4 changes: 2 additions & 2 deletions build/news-feed-config-develop.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"id": "01JEWPAFF93YSF418TH72W1SBA",
"description": "Mulighed for at vise nyhedsindhold.",
"resources": {
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/news-feed.js?ts=1734240677134",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/news-feed-admin.json?ts=1734240677134",
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/news-feed.js?ts=1734244724142",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/news-feed-admin.json?ts=1734244724142",
"schema": "",
"assets": [],
"options": {},
Expand Down
4 changes: 2 additions & 2 deletions build/news-feed-config-main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"id": "01JEWPAFF93YSF418TH72W1SBA",
"description": "Mulighed for at vise nyhedsindhold.",
"resources": {
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/news-feed.js?ts=1734240677134",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/news-feed-admin.json?ts=1734240677134",
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/news-feed.js?ts=1734244724142",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/news-feed-admin.json?ts=1734244724142",
"schema": "",
"assets": [],
"options": {},
Expand Down
2 changes: 1 addition & 1 deletion build/news-feed.js

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions src/news-feed/news-feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,18 @@ function NewsFeed({ slide, content, run, slideDone, executionId }) {
return imageUrl;
};

const image = currentPost ? getImageUrl(currentPost) : null;
const imageUrl = currentPost ? getImageUrl(currentPost) : null;

return (
<>
{currentPost && (
<div className="template-news-feed">
<div className="media-section">
<div
className={`image ${mediaContain ? "media-contain" : ""}`}
style={{
backgroundImage: image ? `url("${image}")` : "",
}}
/>
</div>
<div
className={`media-section ${mediaContain ? "media-contain" : ""}`}
style={{
backgroundImage: imageUrl ? `url("${imageUrl}")` : "",
}}
/>
<div className="text-section">
<h1 className="title">{currentPost.title}</h1>
<div className="author">
Expand Down
11 changes: 3 additions & 8 deletions src/news-feed/news-feed.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@
height: 100%;
width: 100%;
background-color: var(--color-secondary);
background-size: cover;
background-position: top center;

.image {
height: 100%;
width: 100%;
background-size: cover;
background-position: top center;
}

.image.media-contain {
&.media-contain {
background-size: contain;
background-repeat: no-repeat;
}
Expand Down

0 comments on commit d51d094

Please sign in to comment.