Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.

Commit 8dfd6fc

Browse files
author
James Baxley
authored
Minor app tweaks (#1697)
* don't show audio if it isn't there * support new line tags * better handle speakers * eslint and build bump
1 parent f4999d3 commit 8dfd6fc

4 files changed

Lines changed: 38 additions & 18 deletions

File tree

imports/pages/series/series.SingleVideo.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,19 @@ class SeriesSingleVideoWithoutData extends Component {
105105
return (
106106
<div className="background--light-primary">
107107
<SingleVideoPlayer ooyalaId={currentSermon.content.ooyalaId} />
108-
<div
109-
className="soft-sides background--light-secondary text-dark-secondary"
110-
style={{ paddingTop: "15px", paddingBottom: "15px" }}
111-
onClick={this.playAudio}
112-
>
113-
<h7 style={{ verticalAlign: "middle" }}>Listen To Audio</h7>
114-
<i
115-
className="icon-category-audio float-right"
116-
style={{ marginTop: "-2px" }}
117-
/>
118-
</div>
108+
{currentSermon.content.audio.length > 0 && (
109+
<div
110+
className="soft-sides background--light-secondary text-dark-secondary"
111+
style={{ paddingTop: "15px", paddingBottom: "15px" }}
112+
onClick={this.playAudio}
113+
>
114+
<h7 style={{ verticalAlign: "middle" }}>Listen To Audio</h7>
115+
<i
116+
className="icon-category-audio float-right"
117+
style={{ marginTop: "-2px" }}
118+
/>
119+
</div>
120+
)}
119121
<div className="soft soft-double@palm-wide-and-up push-top">
120122
<h2 className="push-half-bottom">{currentSermon.title}</h2>
121123
<h4>{contentHelpers.speakers(currentSermon)}</h4>

imports/util/content/__tests__/content.speakers.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,22 @@ it("returns single speaker with no comma captilized", () => {
1818
expect(result).toBe("Jim Bob");
1919
});
2020

21-
it("returns mutliple speakers comman separated and captilized", () => {
21+
it("returns mutliple speakers comma separated and captilized", () => {
2222
const result = speakers({
2323
content: {
24-
speaker: "jim bob,jimmy jam,jolly jake",
24+
speaker: "jim bob, jimmy jam, jolly jake",
25+
},
26+
});
27+
expect(result).toBe("Jim Bob, Jimmy Jam, Jolly Jake");
28+
});
29+
it("returns mutliple speakers not csv comma separated and captilized", () => {
30+
const result = speakers({
31+
content: {
32+
speaker: `
33+
jim bob
34+
jimmy jam
35+
jolly jake
36+
`,
2537
},
2638
});
2739
expect(result).toBe("Jim Bob, Jimmy Jam, Jolly Jake");

imports/util/content/content.speakers.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11

22
function speakers(contentItem) {
3-
const contentSpeakers = contentItem.content.speaker.split(",");
3+
let contentSpeakers = [];
44

5-
return contentSpeakers.map((speaker) => {
6-
const words = speaker.split(" ");
5+
if (contentItem.content.speaker.indexOf(",") > -1) {
6+
contentSpeakers = contentItem.content.speaker.split(",");
7+
} else {
8+
contentSpeakers = contentItem.content.speaker.split("\n");
9+
}
10+
11+
return contentSpeakers.filter((x) => x.trim()).map((speaker) => {
12+
const words = speaker.trim().split(" ");
713
return words.map((word) => (
814
word.charAt(0).toUpperCase() +
915
word.substr(1, word.length - 1)

mobile-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ App.info({
55
author: "NewSpring Church",
66
email: "web@newspring.cc",
77
website: "https://newspring.cc",
8-
version: "5.0.12",
9-
buildNumber: "187",
8+
version: "5.0.13",
9+
buildNumber: "188",
1010
});
1111

1212
App.icons({

0 commit comments

Comments
 (0)