Skip to content

Commit 803a2ff

Browse files
authored
feat: enable dynamic spotify embed (#364)
* feat: enable spotify * feat: show dynamic embded
1 parent c1cc693 commit 803a2ff

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

client/src/components/podcast/List.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import { PODCAST } from '../../assets/placeholder/podcast';
1313
// Images
1414
import podcastCover from '../../assets/images/podcast_cover.png';
1515

16-
const PodcastList = () => {
16+
const PodcastList = ({ spotify }) => {
1717
const Podcast = PODCAST;
1818
const classes = useStyles();
1919
return (
2020
<Container>
21-
<div className={classes.wrapper}>
21+
{/* <div className={classes.wrapper}>
2222
<Paper>
2323
<Table>
2424
<TableHead>
@@ -57,11 +57,11 @@ const PodcastList = () => {
5757
</TableBody>
5858
</Table>
5959
</Paper>
60-
</div>
60+
</div> */}
6161

6262
<div>
6363
<iframe
64-
src='https://open.spotify.com/embed/episode/7zq8d36zXutK0XXU5xp8kO?utm_source=generator'
64+
src={`https://open.spotify.com/embed/episode/${spotify[0].id}`}
6565
width='100%'
6666
height='152'
6767
frameBorder='0'

client/src/pages/expressions/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ const ExpressionsPage = ({
150150
<Expressions
151151
witsdom={witsdom}
152152
photostory={photostory}
153+
spotify={spotify}
153154
editorial={editorial}
154155
miscellaneous={miscellaneous}
155156
/>

client/src/screens/Expressions.js

+13-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ import ROUTES from '../utils/getRoutes';
2222
// Placeholders
2323
import { CAROUSEL } from '../assets/placeholder/guide';
2424

25-
function Expressions({ witsdom, photostory, editorial, miscellaneous }) {
25+
function Expressions({
26+
witsdom,
27+
photostory,
28+
spotify,
29+
editorial,
30+
miscellaneous,
31+
}) {
2632
const classes = useStyles();
2733

2834
const CONTENT = [
@@ -61,11 +67,11 @@ function Expressions({ witsdom, photostory, editorial, miscellaneous }) {
6167
container: true,
6268
section: <ArticleCardStack articleList={editorial} />,
6369
},
64-
// {
65-
// name: 'Podcasts',
66-
// container: true,
67-
// section: <PodcastList />,
68-
// },
70+
{
71+
name: 'Podcasts',
72+
container: true,
73+
section: <PodcastList spotify={spotify} />,
74+
},
6975
{
7076
name: 'Miscellaneous',
7177
container: true,
@@ -110,7 +116,7 @@ function Expressions({ witsdom, photostory, editorial, miscellaneous }) {
110116
<SectionTitle
111117
heading={name}
112118
link={shortName}
113-
path={path + '/1'}
119+
path={path.includes('http') ? path : path + '/1'}
114120
container={!container}
115121
/>
116122
{section}

client/src/utils/getLinks.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ const SUB_CATEGORIES = {
4444
GALLERY: `${CATEGORIES.EXPRESSIONS}/gallery`,
4545
NITR_IN_MOTION: `${CATEGORIES.EXPRESSIONS}/nitrInMotion`,
4646
EDITORIAL: `${CATEGORIES.EXPRESSIONS}/editorial`,
47-
PODCASTS: `${CATEGORIES.EXPRESSIONS}/podcasts`,
47+
// PODCASTS: `${CATEGORIES.EXPRESSIONS}/podcasts`,
48+
PODCASTS: `https://open.spotify.com/show/7ljgcbXzt4VQRJ1SLIECNf`,
4849
MISCELLANEOUS: `${CATEGORIES.EXPRESSIONS}/miscellaneous`,
4950
},
5051
};

client/src/utils/getRoutes.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,14 @@ const EXPRESSIONS = [
282282
idNumber: 66,
283283
exact: true,
284284
},
285-
// {
286-
// name: 'Podcasts',
287-
// shortName: LINKS.SUB_CATEGORIES.EXPRESSIONS.PODCASTS.split('/')[2],
288-
// path: LINKS.SUB_CATEGORIES.EXPRESSIONS.PODCASTS,
289-
// asyncRoutePath: './Podcast',
290-
// idNumber: 65,
291-
// exact: true,
292-
// },
285+
{
286+
name: 'Podcasts',
287+
shortName: LINKS.SUB_CATEGORIES.EXPRESSIONS.PODCASTS.split('/')[2],
288+
path: LINKS.SUB_CATEGORIES.EXPRESSIONS.PODCASTS,
289+
asyncRoutePath: './Podcast',
290+
idNumber: 65,
291+
exact: true,
292+
},
293293
{
294294
name: 'Miscellaneous',
295295
shortName: LINKS.SUB_CATEGORIES.EXPRESSIONS.MISCELLANEOUS.split('/')[2],

0 commit comments

Comments
 (0)