This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useContext } from 'react'; | |
| import Episodes from './Episodes'; | |
| import { episodesQuery } from './EpisodesQuery'; | |
| import { Query } from "react-apollo"; | |
| import SiteConfigContext from '../../context/SiteConfigContext'; | |
| import { Loading } from 'apm-titan'; | |
| import PropTypes from 'prop-types'; | |
| const EpisodesWithData = (props) => { | |
| const context = useContext(SiteConfigContext); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { gql } from 'apollo-boost'; | |
| export function episodesQuery(contextSlug, pageNum) { | |
| return gql` | |
| { | |
| episodesList: collection(contentAreaSlug: "${contextSlug}", slug: "${contextSlug}" ) { | |
| id | |
| title | |
| results(page: ${pageNum}, pageSize: 18) { | |
| nextPage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useContext } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { Teaser, Pagination, Heading } from 'apm-titan'; | |
| import { Image } from 'apm-mimas'; | |
| import AudioPlayButton from '../AudioPlayButton/AudioPlayButton'; | |
| import { format } from 'date-fns'; | |
| import { Body } from 'amat-react'; | |
| import { truncateAmat } from '../../utils/utils'; | |
| import Icon from '../Icon/Icon'; | |
| import MetaTags from '../../MetaTags/MetaTags'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import App from '../shared/App'; | |
| import React from 'react'; | |
| import { hydrate } from 'react-dom'; | |
| import { ApolloProvider } from 'react-apollo'; | |
| import { HelmetProvider } from 'react-helmet-async'; | |
| import { client } from '../shared/graphql/graphqlClient'; | |
| import '@babel/polyfill'; | |
| const graphqlEnv = window.location.href.match(/local|dev/) ? '-dev' : ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import ReactDOM from 'react-dom/server'; | |
| import { ApolloProvider, renderToStringWithData } from 'react-apollo'; | |
| import { HelmetProvider } from 'react-helmet-async'; | |
| import { ServerLocation } from 'apm-titan'; | |
| // import { client } from '../shared/graphql/graphqlClient'; | |
| import App from '../shared/App'; | |
| import fs from 'fs'; | |
| import os from 'os'; | |
| import { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fetch from 'cross-fetch'; | |
| import { ApolloClient } from 'apollo-client'; | |
| import { createHttpLink } from 'apollo-link-http'; | |
| import { InMemoryCache } from 'apollo-cache-inmemory'; | |
| import FragmentMatcher from './FragmentMatcher'; | |
| const cache = new InMemoryCache({ fragmentMatcher: FragmentMatcher }).restore(window.__APOLLO_STATE__); | |
| export function client(graphqlEnv) { | |
| return new ApolloClient({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <audio controls> | |
| <source src="https://news-utility.stream.publicradio.org/news-utility.aac" type="audio/aac"> | |
| <source src="https://news-utility.stream.publicradio.org/news-utility.mp3" type="audio/mpeg"> | |
| </audio> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const loadScript = function(id, src, callback) { | |
| const existingScript = document.getElementById(id); | |
| if (!existingScript) { | |
| const script = document.createElement('script'); | |
| script.src = src; | |
| script.id = id; | |
| document.body.appendChild(script); | |
| script.onload = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Head from 'next/head'; | |
| import { useRouter } from 'next/router'; | |
| import loadScript from '../../utils/loadScript'; | |
| const Content = ({ | |
| useViafoura, | |
| }) => { | |
| const router = useRouter(); | |
| const source = '//cdn.viafoura.net/vf-v2.js'; | |
| const [viaFouraReady, setViafouraReady] = useState(false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { ReactNode } from 'react'; | |
| import { Notifier } from '@airbrake/browser'; | |
| interface Props { | |
| fallbackUI?: ReactNode; | |
| } | |
| interface StateProps { | |
| hasError: boolean; | |
| } |