From 1c3a5b3409271040bc495ff78b0f521361df0459 Mon Sep 17 00:00:00 2001 From: matteo Date: Sun, 17 Feb 2019 00:17:38 +0100 Subject: [PATCH] maledetto il signore --- src/App.js | 57 +++++++++++----------- src/VideoInfo.js | 99 +++++--------------------------------- src/VideoList.js | 1 - src/areainfo/Wikipedia.js | 27 ++--------- src/css/App.css | 1 + src/index.js | 4 +- src/reccomenders/Recent.js | 9 ++-- 7 files changed, 52 insertions(+), 146 deletions(-) diff --git a/src/App.js b/src/App.js index 9b1eba6..85810b4 100644 --- a/src/App.js +++ b/src/App.js @@ -1,6 +1,5 @@ import React from 'react'; -import { Route, Switch, withRouter, matchPath, HashRouter } from 'react-router-dom'; -import 'bootstrap/dist/css/bootstrap.css'; +import { Route, Switch, withRouter, matchPath } from 'react-router-dom'; import { Row, Col, Button, Collapse } from 'react-bootstrap'; import TopBar from './TopBar'; import VideoPlayer from './VideoPlayer'; @@ -16,54 +15,52 @@ class App extends React.Component { playerHeight: null, navHeight: null, blackbgHeight: null, - dirtyBg: true, isInfoToggled: false, videoId: localStorage['lastId'] }; -// componentDidMount(){ + // componentDidMount() { -// } + // } -// componentDidUpdate(prevProps, prevState) { - -// } + // componentDidUpdate(prevProps, prevState) { -static getDerivedStateFromProps(nextProps, prevState) { - let idMatch = matchPath(nextProps.location.pathname, { - path: "/video/:id", - exact: true, - strict: false - }); - if(idMatch && idMatch.params.id !== prevState.videoId){ - localStorage.setItem('lastId', idMatch.params.id) - return {videoId: idMatch.params.id }; + // } + + static getDerivedStateFromProps(nextProps, prevState) { + let idMatch = matchPath(nextProps.location.pathname, { + path: "/video/:id", + exact: true, + strict: false + }); + if (idMatch && idMatch.params.id !== prevState.videoId) { + localStorage.setItem('lastId', idMatch.params.id) + return { videoId: idMatch.params.id }; } - return null; -} + return null; + } render() { return ( - {/* */} - { this.setState({ navHeight: height }); }}> + - - this.setState({ blackbgHeight: height, dirtyBg: false })} className="row upperSection p-2 px-5" > + + - this.setState({ playerHeight: height })}> - + { this.setState({ playerHeight: height }) }}> + + className="p-0 p-xs-0" + style={window.innerWidth < 992 ? { 'overflow': "auto", 'display': 'fixed', 'maxHeight': this.state.playerHeight * 1.4 + 'px' } : { 'overflow': "auto", 'maxHeight': `${this.state.playerHeight}px` }}> {/* true = style for xs ;; false = style for lg */}