Clean up of console logging and fixing issues
around feature images
This commit is contained in:
parent
2eb491d2b3
commit
307267476c
11 changed files with 16 additions and 15 deletions
|
|
@ -4,7 +4,7 @@ import Link from 'next/link'
|
||||||
|
|
||||||
const EpisodePager = ({ episodedata, config, showdata }) => {
|
const EpisodePager = ({ episodedata, config, showdata }) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
console.log(episodedata)
|
|
||||||
const handlePagination = page => {
|
const handlePagination = page => {
|
||||||
const path = router.pathname
|
const path = router.pathname
|
||||||
const query = router.query
|
const query = router.query
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
|
||||||
const EpisodeSideBar = (epdata) => {
|
const EpisodeSideBar = (epdata) => {
|
||||||
console.log(epdata.epdata.data[0].attributes)
|
|
||||||
return (<div className="side_content col-md-3">
|
return (<div className="side_content col-md-3">
|
||||||
<h2>Latest Episodes</h2>
|
<h2>Latest Episodes</h2>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ import Image from 'next/image';
|
||||||
const FeatureImage = ({ imagedata, basepath }) => (
|
const FeatureImage = ({ imagedata, basepath }) => (
|
||||||
<div className="featuredimage">
|
<div className="featuredimage">
|
||||||
<Image
|
<Image
|
||||||
src={"http://localhost:1337" + imagedata.attributes.url}
|
src={"http://localhost:1337" + imagedata.url}
|
||||||
height={imagedata.attributes.height}
|
height={imagedata.height}
|
||||||
width={imagedata.attributes.width}
|
width={imagedata.width}
|
||||||
priority={true}
|
priority={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { Link } from 'react-router-dom';
|
||||||
import config from '../data/internal/config'
|
import config from '../data/internal/config'
|
||||||
|
|
||||||
const ShowSideBar = (props) => {
|
const ShowSideBar = (props) => {
|
||||||
console.log(props.props.data[0].attributes)
|
|
||||||
return(
|
return(
|
||||||
<div className="side_content col-md-3">
|
<div className="side_content col-md-3">
|
||||||
<Image
|
<Image
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import Link from 'next/link'
|
||||||
|
|
||||||
const StoryPager = ({ storydata }) => {
|
const StoryPager = ({ storydata }) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
console.log(storydata)
|
|
||||||
|
|
||||||
const handlePagination = page => {
|
const handlePagination = page => {
|
||||||
const path = router.pathname
|
const path = router.pathname
|
||||||
|
|
|
||||||
1
data/external/cms.js
vendored
1
data/external/cms.js
vendored
|
|
@ -166,6 +166,7 @@ export const getPodcastSeriesEpisodes = async (podcastId, limit, page) => {
|
||||||
podcast_sery: {
|
podcast_sery: {
|
||||||
Slug: {
|
Slug: {
|
||||||
$eq: podcastId
|
$eq: podcastId
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ class CustomDocument extends Document {
|
||||||
gtag('config', '${GA_TRACKING_ID}', {
|
gtag('config', '${GA_TRACKING_ID}', {
|
||||||
page_path: window.location.pathname,
|
page_path: window.location.pathname,
|
||||||
});
|
});
|
||||||
console.log("Page View")
|
|
||||||
`,
|
`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,15 @@ import Head from 'next/head'
|
||||||
|
|
||||||
const Article = ({article_obj, sections, pagedata, stories, serverRuntimeConfig}) => {
|
const Article = ({article_obj, sections, pagedata, stories, serverRuntimeConfig}) => {
|
||||||
if (!article_obj) return null
|
if (!article_obj) return null
|
||||||
|
|
||||||
|
var featureImage
|
||||||
|
|
||||||
|
if (article_obj.FeatureImage.data) {
|
||||||
|
if (article_obj.FeatureImage.data.attributes.formats.large) {
|
||||||
|
featureImage = article_obj.FeatureImage.data.attributes.formats.large
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(article_obj.FeatureImage)
|
||||||
return ( <Layout sections={sections} pagedata={pagedata}>
|
return ( <Layout sections={sections} pagedata={pagedata}>
|
||||||
<Head>
|
<Head>
|
||||||
<meta name="twitter:card" content="summary" key="twcard" />
|
<meta name="twitter:card" content="summary" key="twcard" />
|
||||||
|
|
@ -17,7 +26,7 @@ const Article = ({article_obj, sections, pagedata, stories, serverRuntimeConfig}
|
||||||
</Head>
|
</Head>
|
||||||
<div className="main_content col-md-9 col-sm-12">
|
<div className="main_content col-md-9 col-sm-12">
|
||||||
{ article_obj.FeatureImage.data != null &&
|
{ article_obj.FeatureImage.data != null &&
|
||||||
<FeatureImage imagedata = {article_obj.FeatureImage.data} basepath = {serverRuntimeConfig.base_path} ></FeatureImage>
|
<FeatureImage imagedata = {featureImage} basepath = {serverRuntimeConfig.base_path} ></FeatureImage>
|
||||||
}
|
}
|
||||||
<h1>{ article_obj.Title }</h1>
|
<h1>{ article_obj.Title }</h1>
|
||||||
<div className="article_body" dangerouslySetInnerHTML={{ __html: article_obj.Body }}></div>
|
<div className="article_body" dangerouslySetInnerHTML={{ __html: article_obj.Body }}></div>
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@ export async function getServerSideProps(context) {
|
||||||
const currpodcastdata = await currpodcastres.json()
|
const currpodcastdata = await currpodcastres.json()
|
||||||
const currpodcastlist = currpodcastdata.data
|
const currpodcastlist = currpodcastdata.data
|
||||||
|
|
||||||
console.log(currpodcastlist)
|
|
||||||
|
|
||||||
const archpodcastres = await fetch(serverRuntimeConfig.base_path + `podcast-series?filters[status][$eq]=false`, {
|
const archpodcastres = await fetch(serverRuntimeConfig.base_path + `podcast-series?filters[status][$eq]=false`, {
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Authorization': serverRuntimeConfig.strapi_token,
|
'Authorization': serverRuntimeConfig.strapi_token,
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@ export async function getServerSideProps(context) {
|
||||||
|
|
||||||
const sepisodes = await getPodcastSeriesEpisodes(episode.data[0].attributes.podcast_sery.data.attributes.Slug, 5, 0)
|
const sepisodes = await getPodcastSeriesEpisodes(episode.data[0].attributes.podcast_sery.data.attributes.Slug, 5, 0)
|
||||||
|
|
||||||
console.log(sepisodes)
|
|
||||||
|
|
||||||
const audiodata = {
|
const audiodata = {
|
||||||
audio_path: serverRuntimeConfig.audio_path,
|
audio_path: serverRuntimeConfig.audio_path,
|
||||||
audio_mp3: episode.data[0].attributes.Audio_MP3.data.attributes
|
audio_mp3: episode.data[0].attributes.Audio_MP3.data.attributes
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,6 @@ export async function getServerSideProps(context) {
|
||||||
const slug = context.params.podcast
|
const slug = context.params.podcast
|
||||||
const showdata = await getPodcastSeries(slug)
|
const showdata = await getPodcastSeries(slug)
|
||||||
|
|
||||||
console.log(showdata.data)
|
|
||||||
|
|
||||||
if(context.query.page == null || context.query.page == '0') {
|
if(context.query.page == null || context.query.page == '0') {
|
||||||
var page = 0;
|
var page = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue