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
adjustYoutubeEmbed = element => { | |
if (element) { | |
const iframes = element.getElementsByTagName("iframe"); | |
for (let i in iframes) { | |
if (iframes[i].src && iframes[i].src.match(/^https:\/\/www\.youtube\.com/)) { | |
let iframe = iframes[i]; | |
iframe.setAttribute("style", "position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;"); | |
const width = iframe.width; | |
const height = iframe.height; | |
let paddingTop = 0; |
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 ErrorPage from 'next/error'; | |
import errorCodeMapper from '../server/error-code-mapper'; | |
const withInitProps = getInitPropsFunc => WrappedComponent => { | |
return class InitProps extends React.Component { | |
static async getInitialProps(args) { | |
try { | |
return await getInitPropsFunc(args); | |
} catch (error) { |