Skip to content

Commit

Permalink
#215 add podcast menu item, podlove API example
Browse files Browse the repository at this point in the history
  • Loading branch information
Fischaela committed May 19, 2022
1 parent 0e30014 commit 5d63277
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/MainNav/MainNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ class MainNav extends Component {
Profile
</NavLink>
</li>
<li className="mainnav__list__element">
<NavLink
activeClassName="mainnav__list__element__link--active"
className="mainnav__list__element__link"
exact
to="/podcast"
>
Podcast
</NavLink>
</li>
<li className="mainnav__list__element">
<NavLink
activeClassName="mainnav__list__element__link--active"
Expand Down
2 changes: 2 additions & 0 deletions src/components/PodcasterinnenRouter/PodcasterinnenRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Faq from '../../containers/Faq/Faq'
import Imprint from '../../containers/Imprint/Imprint'
import NotFound from '../../containers/NotFound/NotFound'
import Podcasterinnen from '../../containers/Podcasterinnen/Podcasterinnen'
import Podcast from '../../containers/Podcast/Podcast'
import Privacy from '../../containers/Privacy/Privacy'
import Profile from '../../containers/Profile/Profile'
import ResetPassword from '../../containers/ResetPassword/ResetPassword'
Expand Down Expand Up @@ -82,6 +83,7 @@ class PodcasterinnenRouter extends Component {
<Route path="/faq" component={Faq} />
<Route path="/imprint" component={Imprint} />
<Route path="/password_resets" component={ResetPassword} />
<Route path="/podcast" component={Podcast} />
<Route path="/podcasterinnen" component={Podcasterinnen} />
<Route path="/privacy" component={Privacy} />
<PrivateRoute sessionState={sessionState} path="/profile" component={Profile} />
Expand Down
1 change: 1 addition & 0 deletions src/containers/Podcast/Podcast.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* .imprint {} */
35 changes: 35 additions & 0 deletions src/containers/Podcast/Podcast.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useEffect, useState } from 'react'

import './Podcast.css'

const Podcast = () => {
const [error, setError] = useState(null)
const [isLoaded, setIsLoaded] = useState(false)
const [items, setItems] = useState([])

useEffect(() => {
document.title = 'Podcast – podcasterinnen.org'
fetch('https://backend.podlovers.org/wp-json/podlove/v2/podcast')
.then(res => res.json())
.then(
(result) => {
setIsLoaded(true)
setItems(result)
},
// Note: it's important to handle errors here
// instead of a catch() block so that we don't swallow
// exceptions from actual bugs in components.
(error) => {
setIsLoaded(true)
setError(error)
}
)
}, [])

return (
<section className="podcast main__section">
</section>
)
}

export default Podcast

0 comments on commit 5d63277

Please sign in to comment.