From 0bbb6d978e1271c35bad9684e82d2faeb8a3ab8e Mon Sep 17 00:00:00 2001 From: matteo Date: Fri, 14 Dec 2018 17:53:15 +0100 Subject: [PATCH] altezze dinamiche in base al dispositivo --- db.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 18 ++++++++++++++++++ package.json | 1 + src/App.js | 22 ++++++++++++---------- src/css/App.css | 8 -------- 5 files changed, 75 insertions(+), 18 deletions(-) create mode 100644 db.json diff --git a/db.json b/db.json new file mode 100644 index 0000000..183e95f --- /dev/null +++ b/db.json @@ -0,0 +1,44 @@ +{ + "videos": [ + { + "id": "cu3K1njbYqs", + "timesWatched": 1, + "lastWatched": "2018-12-02T20:43:18.202Z" + }, + { + "id": "PoSbnAFvqfA", + "timesWatched": 1, + "lastWatched": "2018-12-02T20:43:24.851Z" + }, + { + "id": "rzeLynj1GYM", + "timesWatched": 2, + "lastWatched": "2018-12-02T20:43:45.916Z" + }, + { + "id": "0J2QdDbelmY", + "timesWatched": 1, + "lastWatched": "2018-12-02T20:49:32.498Z" + }, + { + "id": "unRjK82bDLw", + "timesWatched": 2, + "lastWatched": "2018-12-02T20:49:50.769Z" + }, + { + "id": "g2N0TkfrQhY", + "timesWatched": 1, + "lastWatched": "2018-12-02T20:52:07.780Z" + }, + { + "id": "EM4vblG6BVQ", + "timesWatched": 1, + "lastWatched": "2018-12-02T20:52:43.282Z" + }, + { + "id": "tPwqOWK6EFw", + "timesWatched": 1, + "lastWatched": "2018-12-02T20:53:26.049Z" + } + ] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 364aeca..0cf287f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11492,6 +11492,24 @@ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-5.1.0.tgz", "integrity": "sha512-akMy/BQT5m1J3iJIHkSb4qycq2wzllWsmmolaaFVnb+LPV9cIJ/nTud40ZsiiT0H3P+/wXIdbjx2fzF61OaeOQ==" }, + "react-height": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/react-height/-/react-height-3.0.0.tgz", + "integrity": "sha1-+uMi+dpk0+niVTbya3fHOVQmFSQ=", + "requires": { + "prop-types": "15.5.8" + }, + "dependencies": { + "prop-types": { + "version": "15.5.8", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.8.tgz", + "integrity": "sha1-a3suFBCDvjjIWVqlH8VXdccZk5Q=", + "requires": { + "fbjs": "^0.8.9" + } + } + } + }, "react-is": { "version": "16.6.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.6.1.tgz", diff --git a/package.json b/package.json index 872967f..129cb99 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "react-app-polyfill": "^0.1.3", "react-bootstrap": "^1.0.0-beta.2", "react-dom": "^16.6.1", + "react-height": "^3.0.0", "react-linkify": "^0.2.2", "react-router-dom": "^4.3.1", "react-scripts": "2.1.1", diff --git a/src/App.js b/src/App.js index e5a5bd6..cdcabf7 100644 --- a/src/App.js +++ b/src/App.js @@ -6,27 +6,30 @@ import VideoList from './VideoList'; // eslint-disable-line no-unused-vars import TopBar from './TopBar'; // eslint-disable-line no-unused-vars import VideoPlayer from './VideoPlayer'; // eslint-disable-line no-unused-vars import VideoInfo from './VideoInfo'; +import {ReactHeight} from 'react-height'; import './css/App.css'; class App extends React.Component { constructor(props) { super(props); this.state = { - isInfoToggled: false + isInfoToggled: false, + maxHeight: null, + navHeight: null }; } render() { return ( - - - - - + this.setState({navHeight:height})}> + + + this.setState({maxHeight:height})}> + - +
-
- + + - {/* */}
URL not found
} />
diff --git a/src/css/App.css b/src/css/App.css index b009997..afa42af 100644 --- a/src/css/App.css +++ b/src/css/App.css @@ -2,15 +2,7 @@ background-color:#000000; } -@media (min-width: 992px) { - .upperSection{ - background-color:#000000; - height: 55vh; - } -} - .downSection{ overflow: auto !important; - height: 40vh; margin-top: 1vh; } \ No newline at end of file