import React, { Component } from 'react' import './landscape.warning.css' import { LastMuseumLogoNoBlur } from '../icons' const PhoneIcon = ( ) const RotateIcon = ( ) export default class LandscapeWarning extends Component { state = { landscape: false, } constructor(props) { super(props) this.handleResize = this.handleResize.bind(this) window.addEventListener("resize", this.handleResize) this.handleResize() } handleResize() { const landscape = window.innerWidth > window.innerHeight if (landscape !== this.state.landscape) { this.setState({ landscape }) } } render() { const { landscape } = this.state if (!landscape) return null return (
{RotateIcon} {PhoneIcon} {LastMuseumLogoNoBlur}
{'Please rotate your device'}
) } }